Dotclear 2.24
Loading...
Searching...
No Matches
form Class Reference

HTML Forms creation 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)
 

Detailed Description

HTML Forms creation helpers.

Member Function Documentation

◆ combo()

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:

form::combo(['name', 'id'], $data, ['class' => 'maximal', 'extra_html' => 'data-language="php"']);
static combo( $nid, $data, $default='', ?string $class='', ?string $tabindex='', bool $disabled=false, ?string $extra_html='')
Definition: lib.form.php:86

Uses formSelectOption

Parameters
string | array$nidElement ID and name
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

Referenced by themeEditorBehaviors\adminPreferencesForm(), tagsBehaviors\adminUserForm(), adminSearch\displayComments(), adminSearch\displayPosts(), dcDefaultPostActions\doChangePostCategory(), dcDefaultPostActions\doChangePostLang(), dcWidget\formSetting(), dcImportDC1\gui(), dcImportFlat\gui(), dcImportWP\gui(), dcPage\open(), adminUserPreferences\prefLine(), adminUserPreferences\prefsTable(), adminCategories\render(), adminComment\render(), adminComments\render(), adminIndex\render(), adminLangs\render(), adminPopupLink\render(), adminPopupPosts\render(), adminPost\render(), adminPosts\render(), adminUserPrefs\render(), adminSearch\render(), adminUser\render(), adminUsers\render(), adminBlogrollEdit\render(), adminBlowupConfig\render(), adminMaintenance\render(), adminPages\render(), adminPage\render(), adminSimpleMenu\render(), adminTag\render(), adminWidgets\render(), adminConfigThemeDuctile\render(), adminAboutConfig\settingLine(), adminAboutConfig\settingsTable(), and testCombo().

◆ radio()

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$nidElement ID and name
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

Referenced by dcWidget\formSetting(), adminUpdate\render(), adminBlogrollEdit\render(), adminMaintenance\render(), and testRadio().

◆ checkbox()

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$nidElement ID and name
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

Referenced by breadcrumbBehaviors\adminBlogPreferencesForm(), dcMaintenanceAdmin\adminDashboardOptionsForm(), themeEditorBehaviors\adminPreferencesForm(), tagsBehaviors\adminRemoveTags(), dcWidget\formSetting(), dcActions\getCheckboxes(), dcBlogsActions\getCheckboxes(), dcExportFlat\gui(), dcImportWP\gui(), dcFilterWords\gui(), adminMediaList\mediaLine(), pingsAdminBehaviors\pingsFormItems(), adminAuth\render(), adminMedia\render(), adminPost\render(), adminUserPrefs\render(), adminUser\render(), adminUsersActions\render(), adminAntispam\render(), adminBlogrollEdit\render(), adminBlogroll\render(), adminBlowupConfig\render(), adminMaintenance\render(), adminPage\render(), adminPings\render(), adminSimpleMenu\render(), adminConfigThemeDuctile\render(), adminPage\showComments(), adminPost\showComments(), ieMaintenanceExportblog\step(), ieMaintenanceExportfull\step(), and testCheckbox().

◆ field()

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$nidElement ID and name
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

Referenced by dcPage\close(), adminModulesList\displaySearch(), dcDefaultPostActions\doChangePostAuthor(), dcDefaultPostActions\doChangePostCategory(), dcWidget\formSetting(), dcFilterAkismet\gui(), dcExportFlat\gui(), dcImportDC1\gui(), dcImportWP\gui(), dcFilterWords\gui(), adminUserPreferences\prefLine(), adminAuth\render(), adminCategory\render(), adminComment\render(), adminIndex\render(), adminMedia\render(), adminPopupLink\render(), adminPopupPosts\render(), adminPost\render(), adminUserPrefs\render(), adminSearch\render(), adminUser\render(), adminBlogrollEdit\render(), adminBlogroll\render(), adminBlowupConfig\render(), adminPage\render(), adminPings\render(), adminSimpleMenu\render(), adminTag\render(), adminConfigThemeDuctile\render(), adminAboutConfig\settingLine(), ieMaintenanceExportblog\step(), ieMaintenanceExportfull\step(), and testField().

◆ password()

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

Uses form::field

Parameters
string | array$nidElement ID and name
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

Referenced by dcImportDC1\gui(), dcImportFlat\gui(), dcImportWP\gui(), adminAuth\render(), adminLangs\render(), adminUserPrefs\render(), adminUser\render(), adminUsersActions\render(), ieMaintenanceExportblog\step(), ieMaintenanceExportfull\step(), and testPassword().

◆ color()

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

Uses form::field

Parameters
string | array$nidElement ID and name
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

Referenced by dcWidget\formSetting(), adminBlowupConfig\render(), adminConfigThemeDuctile\render(), and testColor().

◆ email()

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

Uses form::field

Parameters
string | array$nidElement ID and name
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

Referenced by dcWidget\formSetting(), adminAuth\render(), adminComment\render(), adminPost\render(), adminUserPrefs\render(), adminUser\render(), adminPage\render(), and testEmail().

◆ url()

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

Uses form::field

Parameters
string | array$nidElement ID and name
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

Referenced by dcImportFeed\gui(), adminComment\render(), adminPost\render(), adminUserPrefs\render(), adminUser\render(), adminBlogrollEdit\render(), adminPage\render(), adminPings\render(), adminConfigThemeDuctile\render(), and testUrl().

◆ datetime()

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

Uses form::field

Parameters
string | array$nidElement ID and name
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

Referenced by adminPost\render(), adminPage\render(), and testDatetime().

◆ date()

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

Uses form::field

Parameters
string | array$nidElement ID and name
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

Referenced by testDate().

◆ time()

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

Uses form::field

Parameters
string | array$nidElement ID and name
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

Referenced by testTime().

◆ file()

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$nidElement ID and name
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

Referenced by testFile().

◆ number()

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$nidElement ID and name
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

Referenced by antispamBehaviors\adminBlogPreferencesForm(), dcWidget\formSetting(), dcPager\getLinks(), dcImportDC1\gui(), dcImportWP\gui(), adminUserPreferences\prefLine(), adminUserPrefs\render(), adminUser\render(), adminAntispam\render(), adminBlogroll\render(), adminPage\render(), adminSimpleMenu\render(), adminWidgets\render(), adminConfigThemeDuctile\render(), adminAboutConfig\settingLine(), adminWidgets\sidebarWidgets(), and testNumber().

◆ textArea()

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$nidElement ID and name
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

Referenced by testTextArea().

◆ hidden()


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