Retrieving the form class object
$frm = e107::getForm();
Returns a form opening tag.
$frm->open('myform'); // returns
$frm->open('myform', 'get', 'myscript.php', array('autocomplete' => 'on', 'class' => 'formclass'));
Name | Description |
---|---|
$name | string - form name |
$mode | string - post | get - 'post' by default |
$target | string - request URL - e_REQUEST_URI by default |
$options | array - specify options such as class or autocomplete |
Returns a form closing tag
$frm->close(); // returns
Returns a text field form element
$frm->text('my-field', 'current_value', 100, array('size' => 'large')); // returns <input class="tbox input-large" id="my-field" maxlength="100" name="my-field" type="text" value="current_value"></input>
Name | Description |
---|---|
$name | string - name of the text field |
$value | string - value of the text fieldt |
$maxlength | integer - specifies maxlength element of the text field |
$options | array - specify options such as class, size or selectize size: mini, small, medium, large, xlarge, xxlarge selectize: array with selectize.js options |
$frm->textarea($name,$value,$rows,$cols,$options,$counter);
$frm->bbarea($name,$value,$template,$mediaCat,$size,$options);
Name | Description |
---|---|
$name | string - Name of the field |
$value | string - Contents of the field |
$template | (optional) string - A string defining the button template to use with bbarea. Included in the core are the following: news, submitnews, extended, admin, mailout, page, comment, signature But you can also use the name of the plugin (e.g. forum) if the plugin provides a bbcode_template.php |
$mediaCat | (optional) string - Name of the nedia catalog to use (default: _common) Is only used by tinymce (if installed and used) |
$size | (optional) string - Size of the bbarea/editor. Use one of the following values: tiny, small, medium, large (default: large) |
$options |
(optional) array - Array with options to use with the editor:
|
$frm->select($name,$option_array,$selected,$options,$defaultBlank);
$frm->checkbox($name,$value,$checked,$options);
$frm->hidden($name,$value,$options);
$frm->button($name,$value,$action,$label,$options);
$frm->carousel($name, $array, $options);
$array = array(
'slide1' => array('caption' => 'Slide 1', 'text' => 'first slide content' ),
'slide2' => array('caption' => 'Slide 2', 'text' => 'second slide content' ),
'slide3' => array('caption' => 'Slide 3', 'text' => 'third slide content' )
);
echo $frm->carousel('my-carousel', $array);
$frm->tabs($array,$options);
$array = array(
'home' => array('caption' => 'Home', 'text' => 'some tab content' ),
'other' => array('caption' => 'Other', 'text' => 'second tab content' )
);
echo $frm->tabs($array);
echo $frm->tabs($array, array('active'=>'other')); // make 'other' the initial active tab.