Class kartik\base\Html5Input
Inheritance | kartik\base\Html5Input » kartik\base\InputWidget » yii\widgets\InputWidget |
---|---|
Uses Traits | kartik\base\TranslationTrait, kartik\base\WidgetTrait |
Available since version | 1.0 |
Html5Input widget is a widget encapsulating the HTML 5 inputs.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$addon | array | The addon content - prepend: array/string the prepend addon content. | kartik\base\Html5Input |
$containerOptions | array | The HTML attributes for the widget container | kartik\base\Html5Input |
$convertFormat | boolean | Whether the widget should automatically format the date from the PHP DateTime format to the javascript/jquery plugin format | kartik\base\InputWidget |
$data | array | The data (for list inputs) | kartik\base\InputWidget |
$disabled | boolean | Whether input is to be disabled | kartik\base\InputWidget |
$html5Container | array | The HTML attributes for the HTML-5 input container | kartik\base\Html5Input |
$html5Options | array | The HTML attributes for the HTML-5 input. | kartik\base\Html5Input |
$i18n | array | The the internalization configuration for this widget | kartik\base\InputWidget |
$language | string | The language configuration (e.g. 'fr-FR', 'zh-CN'). | kartik\base\InputWidget |
$noSupport | string|boolean | The message shown for unsupported browser. | kartik\base\Html5Input |
$noSupportOptions | string | Array the HTML attributes for container displaying unsupported browser message | kartik\base\Html5Input |
$pluginEvents | array | Widget JQuery events. | kartik\base\InputWidget |
$pluginLoading | mixed | Show loading indicator while plugin loads | kartik\base\InputWidget |
$pluginName | string | The name of the jQuery plugin | kartik\base\InputWidget |
$pluginOptions | array | Widget plugin options | kartik\base\InputWidget |
$readonly | boolean | Whether input is to be readonly | kartik\base\InputWidget |
$size | string | One of the SIZE modifiers 'lg', 'md', 'sm', 'xs' | kartik\base\Html5Input |
$type | string | The HTML 5 input type | kartik\base\Html5Input |
$width | string | The width in 'px' or '%' of the HTML5 input container | kartik\base\Html5Input |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_dataVar | string | The hashed variable to store the pluginOptions | kartik\base\InputWidget |
$_encOptions | string | The Json encoded options | kartik\base\InputWidget |
$_hashVar | string | The hashed variable to store the pluginOptions | kartik\base\InputWidget |
$_lang | string | The two or three letter lowercase code for the language according to ISO-639 | kartik\base\InputWidget |
$_langFile | string | The language js file | kartik\base\InputWidget |
$_loadIndicator | string | The indicator for loading | kartik\base\InputWidget |
$_msgCat | string | Translation message file category name for i18n | kartik\base\InputWidget |
Public Methods
Method | Description | Defined By |
---|---|---|
init() | Runs the widget | kartik\base\Html5Input |
initI18N() | Yii i18n messages configuration for generating translations | kartik\base\TranslationTrait |
registerAssets() | Registers the needed assets | kartik\base\Html5Input |
Protected Methods
Method | Description | Defined By |
---|---|---|
addAsset() | Adds an asset to the view | kartik\base\WidgetTrait |
convertDateFormat() | Automatically convert the date format from PHP DateTime to Javascript DateTime format | kartik\base\InputWidget |
getAddonContent() | Parses and returns addon content | kartik\base\Html5Input |
getHtml5Input() | Gets the HTML5 input return string | kartik\base\Html5Input |
getInput() | Generates an input | kartik\base\InputWidget |
getPluginScript() | Returns the plugin registration script | kartik\base\WidgetTrait |
hashPluginOptions() | Generates a hashed variable to store the pluginOptions. The following special data attributes will also be setup for the input widget, that can be accessed through javascript : - 'data-krajee-{name}' will store the hashed variable storing the plugin options. The {name} tag will represent the plugin name (e.g. select2, typeahead etc.) - Fixes issue #6. | kartik\base\WidgetTrait |
initDisability() | Validates and sets disabled or readonly inputs | kartik\base\InputWidget |
initInput() | kartik\base\Html5Input | |
initLanguage() | Initialize the plugin language | kartik\base\InputWidget |
parseDateFormat() | Parses date format based on attribute type using yii\helpers\FormatConverter Used only within DatePicker and DateTimePicker. | kartik\base\InputWidget |
registerPlugin() | Registers a specific plugin and the related events | kartik\base\WidgetTrait |
registerPluginOptions() | Registers plugin options by storing it in a hashed javascript variable | kartik\base\WidgetTrait |
renderInput() | Renders the special HTML5 input Mainly useful for the color and range inputs | kartik\base\Html5Input |
setDataVar() | Sets HTML5 data variable | kartik\base\WidgetTrait |
setLanguage() | Sets the language JS file if it exists | kartik\base\InputWidget |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
LOAD_PROGRESS | ' |
kartik\base\InputWidget |
Property Details
The addon content
- prepend: array/string the prepend addon content. If set as an array, the
following options can be set:
- content: string the prepend addon content
- asButton: boolean whether the addon is a button
- options: array the HTML attributes for the prepend addon
- append: array/string the append addon content. If set as an array, the
following options can be set:
- content: string the append addon content
- asButton: boolean whether the addon is a button
- options: array the HTML attributes for the append addon
- preCaption: array/string the addon content placed before the caption. If
set as an array, the following options can be set:
- content: string the append addon content
- asButton: boolean whether the addon is a button
- options: array the HTML attributes for the append addon
The HTML attributes for the widget container
The HTML attributes for the HTML-5 input container
The HTML attributes for the HTML-5 input.
The message shown for unsupported browser. If set to false will not be displayed
Array the HTML attributes for container displaying unsupported browser message
One of the SIZE modifiers 'lg', 'md', 'sm', 'xs'
The HTML 5 input type
The width in 'px' or '%' of the HTML5 input container
Method Details
Parses and returns addon content
protected static string getAddonContent ( $addon ) | ||
$addon |
Gets the HTML5 input return string
protected void getHtml5Input ( ) |
Runs the widget
public void init ( ) |
protected void initInput ( ) |
Registers the needed assets
public void registerAssets ( ) |
Renders the special HTML5 input Mainly useful for the color and range inputs
protected void renderInput ( ) |