Dotclear  2.29
 All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
form Class Reference

HTML Form helpers. More...

Static Public Member Functions

static combo ($nid, $data, $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '')
 
static radio ($nid, $value, $checked=false,?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '')
 
static checkbox ($nid, $value, $checked=false,?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '')
 
static field ($nid,?int $size,?int $max, $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $type= 'text',?string $autocomplete= '')
 
static password ($nid, int $size,?int $max, $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static color ($nid, $size=7,?int $max=7,?string $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static email ($nid, $size=20,?int $max=255,?string $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static url ($nid, $size=20,?int $max=255,?string $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static datetime ($nid, $size=16,?int $max=16,?string $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static date ($nid, $size=10,?int $max=10,?string $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static time ($nid, $size=5,?int $max=5,?string $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static file ($nid, $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false)
 
static number ($nid, $min=null,?int $max=null,?string $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static textArea ($nid, int $cols, int $rows, $default= '',?string $class= '',?string $tabindex= '', bool $disabled=false,?string $extra_html= '', bool $required=false,?string $autocomplete= '')
 
static hidden ($nid, $value)
 

Static Private Member Functions

static getDefaults (string $class, string $method)
 

Detailed Description

HTML Form helpers.

Deprecated:
Since 2.26, use Dotclear* instead

Member Function Documentation

static getDefaults ( string  $class,
string  $method 
)
staticprivate

return an associative array of optional parameters of a class method

Parameters
string$classclass name
string$methodmethod name
Returns
array<string, mixed>
static combo (   $nid,
  $data,
  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '' 
)
static

Select Box

Returns HTML code for a select box. $nid could be a string or an array of name and ID. $data is an array with option titles keys and values in values or an array of object of type formSelectOption. If $data is an array of arrays, optgroups will be created.

$default could be a string or an associative array of any of optional parameters:

```php form::combo(['name', 'id'], $data, ['class' => 'maximal', 'extra_html' => 'data-language="php"']); ```

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$dataSelect box data
mixed$defaultDefault value in select box | associative array of optional parameters
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Select instead

Referenced by BackendBehaviors\adminPreferencesForm(), BackendBehaviors\adminUserForm(), Search\displayComments(), Search\displayPosts(), WidgetsElement\formSetting(), ModuleImportFlat\gui(), ModuleImportDc1\gui(), ModuleImportWp\gui(), Manage\prefLine(), LinkPopup\render(), PostsPopup\render(), Posts\render(), Home\render(), Search\render(), Comments\render(), ManagePosts\render(), Categories\render(), ManageEdit\render(), Manage\render(), Langs\render(), Wizard\render(), Comment\render(), User\render(), Config\render(), ManagePage\render(), Post\render(), UserPreferences\render(), and Manage\settingLine().

Here is the caller graph for this function:

static radio (   $nid,
  $value,
  $checked = false,
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '' 
)
static

Radio button

Returns HTML code for a radio button. $nid could be a string or an array of name and ID. $checked could be a boolean or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$valueElement value
mixed$checkedTrue if checked | associative array of optional parameters
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Radio instead

Referenced by WidgetsElement\formSetting(), ManageEdit\render(), and Manage\render().

Here is the caller graph for this function:

static checkbox (   $nid,
  $value,
  $checked = false,
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '' 
)
static

Checkbox

Returns HTML code for a checkbox. $nid could be a string or an array of name and ID. $checked could be a boolean or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$valueElement value
mixed$checkedTrue if checked | associative array of optional parameters
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Checkbox instead

Referenced by BackendBehaviors\adminBlogPreferencesForm(), BackendBehaviors\adminDashboardOptionsForm(), BackendBehaviors\adminPreferencesForm(), BackendBehaviors\adminRemoveTags(), ListingBlogs\blogLine(), ListingComments\commentLine(), IpV6\displayForms(), Ip\displayForms(), ThemesList\displayModules(), ModulesList\displayModules(), WidgetsElement\formSetting(), Words\gui(), ModuleExportFlat\gui(), ModuleImportWp\gui(), ListingMedia\mediaLine(), BackendBehaviors\pingsFormItems(), BackendList\postLine(), ListingPosts\postLine(), Manage\render(), ManageEdit\render(), User\render(), Config\render(), Media\render(), ManagePage\render(), Post\render(), UserPreferences\render(), ManagePage\showComments(), Post\showComments(), ExportFullMaintenanceTask\step(), ExportBlogMaintenanceTask\step(), and ListingUsers\userLine().

Here is the caller graph for this function:

static field (   $nid,
?int  $size,
?int  $max,
  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $type = 'text',
?string  $autocomplete = '' 
)
static

Input field

Returns HTML code for an input field. $nid could be a string or an array of name and ID. $default could be a string or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
integer$sizeElement size
integer$maxElement maxlength
mixed$defaultElement value | associative array of optional parameters
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$typeInput type
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Input instead

Referenced by Page\close(), IpV6\displayForms(), Ip\displayForms(), ModulesList\displayManualForm(), ModulesList\displaySearch(), WidgetsElement\formSetting(), Words\gui(), ModuleImportDc1\gui(), AntispamFilterAkismet\gui(), ModuleExportFlat\gui(), ModuleImportWp\gui(), Manage\prefLine(), LinkPopup\render(), PostsPopup\render(), Home\render(), Search\render(), ManagePosts\render(), ManageEdit\render(), Category\render(), Manage\render(), Wizard\render(), Comment\render(), User\render(), Config\render(), Media\render(), ManagePage\render(), Install\render(), Post\render(), UserPreferences\render(), Manage\settingLine(), ExportFullMaintenanceTask\step(), and ExportBlogMaintenanceTask\step().

Here is the caller graph for this function:

static password (   $nid,
int  $size,
?int  $max,
  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

Password field

Returns HTML code for a password field. $nid could be a string or an array of name and ID. $default could be a string or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
integer$sizeElement size
integer$maxElement maxlength
mixed$defaultElement value | associative array of optional parameters
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant (new-password/current-password)
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Password instead

Referenced by ModulesList\displayManualForm(), ModuleImportFlat\gui(), ModuleImportDc1\gui(), ModuleImportWp\gui(), Langs\render(), Wizard\render(), User\render(), Install\render(), UserPreferences\render(), ExportFullMaintenanceTask\step(), and ExportBlogMaintenanceTask\step().

Here is the caller graph for this function:

static color (   $nid,
  $size = 7,
?int  $max = 7,
?string  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

HTML5 Color field

Returns HTML code for an input color field. $nid could be a string or an array of name and ID. $size could be a integer or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$sizeElement size | associative array of optional parameters
integer$maxElement maxlength
string$defaultElement value
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Color instead

Referenced by WidgetsElement\formSetting(), and Config\render().

Here is the caller graph for this function:

static email (   $nid,
  $size = 20,
?int  $max = 255,
?string  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

HTML5 Email field

Returns HTML code for an input email field. $nid could be a string or an array of name and ID. $size could be a integer or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$sizeElement size | associative array of optional parameters
integer$maxElement maxlength
string$defaultElement value
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Email instead

Referenced by WidgetsElement\formSetting(), Wizard\render(), Comment\render(), User\render(), ManagePage\render(), Install\render(), Post\render(), and UserPreferences\render().

Here is the caller graph for this function:

static url (   $nid,
  $size = 20,
?int  $max = 255,
?string  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

HTML5 URL field

Returns HTML code for an input (absolute) URL field. $nid could be a string or an array of name and ID. $size could be a integer or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$sizeElement size | associative array of optional parameters
integer$maxElement maxlength
string$defaultElement value
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Url instead

Referenced by ModuleImportFeed\gui(), Manage\render(), ManageEdit\render(), Comment\render(), User\render(), Config\render(), ManagePage\render(), Post\render(), and UserPreferences\render().

Here is the caller graph for this function:

static datetime (   $nid,
  $size = 16,
?int  $max = 16,
?string  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

HTML5 Datetime (local) field

Returns HTML code for an input datetime field. $nid could be a string or an array of name and ID. $size could be a integer or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$sizeElement size | associative array of optional parameters
integer$maxElement maxlength
string$defaultElement value (in YYYY-MM-DDThh:mm format)
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Datetime instead

Referenced by ManagePage\render(), and Post\render().

Here is the caller graph for this function:

static date (   $nid,
  $size = 10,
?int  $max = 10,
?string  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

HTML5 Date field

Returns HTML code for an input date field. $nid could be a string or an array of name and ID. $size could be a integer or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$sizeElement size | associative array of optional parameters
integer$maxElement maxlength
string$defaultElement value (in YYYY-MM-DD format)
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Date instead
static time (   $nid,
  $size = 5,
?int  $max = 5,
?string  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

HTML5 Time (local) field

Returns HTML code for an input time field. $nid could be a string or an array of name and ID. $size could be a integer or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$sizeElement size | associative array of optional parameters
integer$maxElement maxlength
string$defaultElement value (in hh:mm format)
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Time instead
static file (   $nid,
  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false 
)
static

HTML5 file field

Returns HTML code for an input file field. $nid could be a string or an array of name and ID. $default could be a integer or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$defaultElement value | associative array of optional parameters
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/File instead
static number (   $nid,
  $min = null,
?int  $max = null,
?string  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

HTML5 number input field

Returns HTML code for an number input field. $nid could be a string or an array of name and ID. $min could be a string or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
mixed$minElement min value (may be negative) | associative array of optional parameters
integer$maxElement max value (may be negative)
string$defaultElement value
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Number instead

Referenced by BackendBehaviors\adminBlogPreferencesForm(), WidgetsElement\formSetting(), Pager\getLinks(), ModuleImportDc1\gui(), ModuleImportWp\gui(), BackendList\postLine(), Manage\prefLine(), Manage\render(), User\render(), Config\render(), ManagePage\render(), UserPreferences\render(), Manage\settingLine(), and Manage\sidebarWidgets().

Here is the caller graph for this function:

static textArea (   $nid,
int  $cols,
int  $rows,
  $default = '',
?string  $class = '',
?string  $tabindex = '',
bool  $disabled = false,
?string  $extra_html = '',
bool  $required = false,
?string  $autocomplete = '' 
)
static

Textarea

Returns HTML code for a textarea. $nid could be a string or an array of name and ID. $default could be a string or an associative array of any of optional parameters

Parameters
string|array{0string, 1?: string}|null $nid The identifier
integer$colsNumber of columns
integer$rowsNumber of rows
mixed$defaultElement value | associative array of optional parameters
string$classElement class name
string$tabindexElement tabindex
boolean$disabledTrue if disabled
string$extra_htmlExtra HTML attributes
boolean$requiredElement is required
string$autocompleteAutocomplete attributes if relevant
Returns
string
Deprecated:
Since 2.26, use Dotclear/Helper/Html/Form/Textarea instead

The documentation for this class was generated from the following file: