Class kartik\editable\Editable

Inheritancekartik\editable\Editable » kartik\base\InputWidget » yii\widgets\InputWidget » yii\base\Widget » yii\base\Component » yii\base\BaseObject
Implementskartik\base\BootstrapInterface, yii\base\Configurable, yii\base\ViewContextInterface
Uses Traitskartik\base\BootstrapTrait, kartik\base\TranslationTrait, kartik\base\WidgetTrait
Available since version1.0

An extended editable widget for Yii Framework 2.

See also http://github.com/kartik-v/yii2-editable.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$additionalData array Additional data to be passed when editable is submitted via ajax request as $key => $value pairs. kartik\editable\Editable
$afterInput string|Closure The content to be placed after the rendered input. kartik\editable\Editable
$ajaxSettings boolean Additional ajax settings to pass to the plugin. kartik\editable\Editable
$animationDelay integer|string Editable fade animation delay (in micro-seconds). kartik\editable\Editable
$asPopover boolean Whether to show the editable input as a popover. kartik\editable\Editable
$attribute string|null The model attribute that this widget is associated with. yii\widgets\InputWidget
$autoIdPrefix string The prefix to the automatically generated widget IDs. yii\base\Widget
$baseSourcePath string|false Get parsed base source path based on $sourcePath setting. If $sourcePath is not set, it will return the current working directory of this widget class. kartik\base\WidgetTrait
$beforeInput string|Closure The content to be placed before the rendered input. kartik\editable\Editable
$behaviors yii\base\Behavior[] List of behaviors attached to this component. yii\base\Component
$bsColCssPrefixes array The bootstrap grid column css prefixes mapping, the key is the bootstrap versions, and the value is an array containing the sizes and their corresponding grid column css prefixes. kartik\base\BootstrapTrait
$bsCssMap array CSS conversion mappings across bootstrap library versions. kartik\base\BootstrapTrait
$bsExtBasename integer The yii2 bootstrap extension base name (readonly property available via getter method getBsExtBasename()) kartik\base\BootstrapTrait
$bsVer integer Bootstrap version number currently set (readonly property available via getter method getBsVer()) kartik\base\BootstrapTrait
$bsVersion integer|string The bootstrap library version that you wish to use for this specific extension / widget. kartik\base\BootstrapTrait
$buttonsTemplate string The template for rendering the buttons kartik\editable\Editable
$closeOnBlur boolean Whether to close the editable form when it loses focus. kartik\editable\Editable
$containerOptions array The HTML attributes for the editable container kartik\editable\Editable
$contentOptions array The HTML attributes for the container enclosing the main content in the popover dialog. kartik\editable\Editable
$convertFormat boolean Whether the widget should automatically format the date from the PHP DateTime format to the javascript/jquery plugin format. kartik\base\InputWidget
$counter integer A counter used to generate $id for widgets. yii\base\Widget
$data array The data (for list inputs) kartik\base\InputWidget
$defaultBtnCss string Default bootstrap button CSS (readonly property available via getter method getDefaultBtnCss()) kartik\base\BootstrapTrait
$defaultEditableBtnIcon string The default icon for editable button set as the label in $editableButtonOptions. kartik\editable\Editable
$defaultIconPrefix string Default icon prefix (readonly property available via getter method getDefaultIconPrefix()) kartik\base\BootstrapTrait
$defaultOptions array Default HTML attributes or other settings for widgets. kartik\base\WidgetTrait
$defaultPluginOptions array Default plugin options for the widget kartik\base\WidgetTrait
$defaultPreHeaderIcon string The default icon for editable button used in the $preHeader. kartik\editable\Editable
$defaultResetBtnIcon string The default icon for editable button used in the $preHeader. kartik\editable\Editable
$defaultSubmitBtnIcon string The default icon for editable button used in the $preHeader. kartik\editable\Editable
$disabled boolean Whether input is to be disabled kartik\base\InputWidget
$displayValue string The value to be displayed. kartik\editable\Editable
$displayValueConfig array The configuration to auto-calculate display value, based on the value of the editable input. kartik\editable\Editable
$dropdownClass string Bootstrap dropdown class name based on currently configured bootstrap version (readonly property available via getter method getDropdownClass()) kartik\base\BootstrapTrait
$editableButtonOptions array The HTML attributes for the editable button to be displayed when the format has been set to 'button': - label: string, the editable button label. kartik\editable\Editable
$editableValueOptions array The HTML attributes for the editable value displayed kartik\editable\Editable
$encodeOutput boolean Whether to HTML encode the output via javascript after editable update. kartik\editable\Editable
$field yii\widgets\ActiveField Active input field, which triggers this widget rendering. yii\widgets\InputWidget
$footer string The footer content in the popover dialog or inline panel. kartik\editable\Editable
$form yii\widgets\ActiveForm kartik\editable\Editable
$formClass array The class for the ActiveForm widget to be used. kartik\editable\Editable
$formOptions array The options for the ActiveForm widget class selected in formClass. kartik\editable\Editable
$format string The display format for the editable. kartik\editable\Editable
$hashVarLoadPosition integer The position where the client JS hash variables for the input widget will be loaded. kartik\base\WidgetTrait
$header string The header content in the popover dialog or inline panel. kartik\editable\Editable
$i18n array The the internalization configuration for this widget. kartik\base\TranslationTrait
$id string|null ID of the widget. Note that the type of this property differs in getter and setter. See getId() and setId() for details. yii\base\Widget
$inlineSettings array The settings for the inline editable when $asPopover is false. kartik\editable\Editable
$inputContainerOptions array The HTML attributes for the input container applicable only when not using with ActiveForm kartik\editable\Editable
$inputFieldConfig array The ActiveField configuration, if you are using with model. kartik\editable\Editable
$inputType array The input type to render for the editing the input in the editable form. kartik\editable\Editable
$language string The language configuration (e.g. 'fr-FR', 'zh-CN'). kartik\base\InputWidget
$model yii\base\Model|null The data model that this widget is associated with. yii\widgets\InputWidget
$moduleId string The module identifier if this widget is part of a module. kartik\base\WidgetTrait
$name string|null The input name. yii\widgets\InputWidget
$options array The options for the input. kartik\editable\Editable
$pjaxContainerId string The identifier for the PJAX widget container if the editable widget is to be rendered inside a PJAX container. kartik\editable\Editable
$pjaxDuplicationFix boolean Prevent duplication of pjax containers when browser back & forward buttons are pressed. kartik\base\WidgetTrait
$placement string The popover placement. kartik\editable\Editable
$pluginDestroyJs string The javascript that will be used to destroy the jQuery plugin kartik\base\WidgetTrait
$pluginEvents array Widget JQuery events. kartik\base\WidgetTrait
$pluginLoading boolean Show loading indicator while plugin loads kartik\base\InputWidget
$pluginName string The plugin name kartik\base\WidgetTrait
$pluginOptions array Widget plugin options. kartik\base\WidgetTrait
$preHeader string The header content placed before the header text in the popover dialog or inline panel. kartik\editable\Editable
$readonly boolean Whether input is to be readonly kartik\base\InputWidget
$resetButton array The HTML attributes for the form reset button. kartik\editable\Editable
$resetDelay integer Editable reset delay (in micro-seconds). kartik\editable\Editable
$selectAllOnEdit boolean Whether to select all text in the input when editable is opened. kartik\editable\Editable
$showAjaxErrors boolean Whether to display any ajax processing errors. kartik\editable\Editable
$showButtonLabels boolean Whether you want to show the button labels. kartik\editable\Editable
$showButtons boolean Whether you wish to automatically display the form submit and reset buttons. kartik\editable\Editable
$size string The size of the popover window. kartik\editable\Editable
$sourcePath string Directory path to the original widget source. kartik\base\WidgetTrait
$stack yii\base\Widget[] The widgets that are currently being rendered (not ended). yii\base\Widget
$submitButton array The HTML attributes for the form submit button. kartik\editable\Editable
$submitOnEnter boolean Whether to auto submit/save the form on pressing ENTER key. kartik\editable\Editable
$type string The popover contextual type. kartik\editable\Editable
$validationDelay integer Editable submission validation delay (in micro-seconds). kartik\editable\Editable
$value string The input value. yii\widgets\InputWidget
$valueIfNull string The value to display if the displayValue is null. kartik\editable\Editable
$view yii\web\View The view object that can be used to render views or view files. Note that the type of this property differs in getter and setter. See getView() and setView() for details. yii\base\Widget
$viewPath string The directory containing the view files for this widget. yii\base\Widget
$widgetClass string Any custom widget class to use. kartik\editable\Editable

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_bsVer integer Current bootstrap version number kartik\base\BootstrapTrait
$_dataVar string The HTML5 data variable name that will be used to store the Json encoded pluginOptions within the element on which the jQuery plugin will be initialized. kartik\base\WidgetTrait
$_defaultBtnCss string Default bootstrap button CSS kartik\base\BootstrapTrait
$_defaultIconPrefix string Default icon CSS prefix kartik\base\BootstrapTrait
$_encOptions string The JSON encoded plugin options. kartik\base\WidgetTrait
$_form yii\widgets\ActiveForm Active form instance kartik\editable\Editable
$_hashVar string The generated hashed variable name that will store the JSON encoded pluginOptions in yii\web\View::POS_HEAD. kartik\base\WidgetTrait
$_icons array Configuration of icons for BS3 and BS4 kartik\editable\Editable
$_inputOptions array The HTML attributes or options for the input/widget kartik\editable\Editable
$_isBs4 boolean Flag to detect whether bootstrap 4. kartik\base\BootstrapTrait
$_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 to be displayed while plugin is loading. kartik\base\InputWidget
$_msgCat string The i18n message category kartik\editable\Editable
$_popoverOptions array The generated configuration for the kartik\popover\PopoverX widget. kartik\editable\Editable

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Calls the named method which is not a class method. yii\base\Component
__clone() This method is called after the object is created by cloning an existing one. yii\base\Component
__construct() Constructor. yii\base\BaseObject
__get() Returns the value of a component property. yii\base\Component
__isset() Checks if a property is set, i.e. defined and not null. yii\base\Component
__set() Sets the value of a component property. yii\base\Component
__unset() Sets a component property to be null. yii\base\Component
addCssClass() Adds bootstrap CSS class to options by parsing the bootstrap version for the specified Bootstrap CSS type. kartik\base\BootstrapTrait
afterRun() This method is invoked right after a widget is executed. yii\base\Widget
attachBehavior() Attaches a behavior to this component. yii\base\Component
attachBehaviors() Attaches a list of behaviors to the component. yii\base\Component
beforeRun() This method is invoked right before the widget is executed. yii\base\Widget
begin() Begins a widget. yii\base\Widget
behaviors() Returns a list of behaviors that this component should behave as. yii\base\Component
canGetProperty() Returns a value indicating whether a property can be read. yii\base\Component
canSetProperty() Returns a value indicating whether a property can be set. yii\base\Component
className() Returns the fully qualified name of this class. yii\base\BaseObject
detachBehavior() Detaches a behavior from the component. yii\base\Component
detachBehaviors() Detaches all behaviors from the component. yii\base\Component
end() Ends a widget. yii\base\Widget
ensureBehaviors() Makes sure that the behaviors declared in behaviors() are attached to this component. yii\base\Component
getBSClass() Gets the respective Bootstrap class based on currently configured bootstrap version. kartik\base\BootstrapTrait
getBaseSourcePath() Get parsed base source path based on $sourcePath setting. If $sourcePath is not set, it will return the current working directory of this widget class. kartik\base\WidgetTrait
getBehavior() Returns the named behavior object. yii\base\Component
getBehaviors() Returns all behaviors attached to this component. yii\base\Component
getBsVer() Gets the current set bootstrap version number. kartik\base\BootstrapTrait
getCssClass() Gets bootstrap css class by parsing the bootstrap version for the specified BS CSS type. kartik\base\BootstrapTrait
getDefaultBtnCss() Gets the default button CSS kartik\base\BootstrapTrait
getDefaultIconPrefix() Gets the default icon css prefix kartik\base\BootstrapTrait
getDropdownClass() Gets the respective bootstrap dropdown class name based on currently configured bootstrap version. kartik\base\BootstrapTrait
getForm() Gets the form instance for use at runtime kartik\editable\Editable
getId() Returns the ID of the widget. yii\base\Widget
getView() kartik\base\WidgetTrait
getViewPath() Returns the directory containing the view files for this widget. yii\base\Widget
hasEventHandlers() Returns a value indicating whether there is any handler attached to the named event. yii\base\Component
hasMethod() Returns a value indicating whether a method is defined. yii\base\Component
hasProperty() Returns a value indicating whether a property is defined for this component. yii\base\Component
init() Initializes the widget. kartik\editable\Editable
initI18N() Yii i18n messages configuration for generating translations kartik\base\TranslationTrait
isBs() Validate Bootstrap version kartik\base\BootstrapTrait
isBs4() Validate if Bootstrap 4.x version. kartik\base\BootstrapTrait
off() Detaches an existing event handler from this component. yii\base\Component
on() Attaches an event handler to an event. yii\base\Component
registerAssets() Registers the client assets for kartik\editable\Editable widget. kartik\editable\Editable
registerWidgetJs() Registers a JS code block for the widget. kartik\base\WidgetTrait
removeCssClass() Removes bootstrap CSS class from options by parsing the bootstrap version for the specified Bootstrap CSS type. kartik\base\BootstrapTrait
render() Renders a view. yii\base\Widget
renderFile() Renders a view file. yii\base\Widget
run() Executes the widget. kartik\editable\Editable
setId() Sets the ID of the widget. yii\base\Widget
setView() Sets the view object to be used by this widget. yii\base\Widget
trigger() Triggers an event. yii\base\Component
widget() Creates a widget instance and runs it. yii\base\Widget

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
addAsset() Adds an asset to the view. kartik\base\WidgetTrait
configureBsVersion() Configures the bootstrap version settings kartik\base\BootstrapTrait
convertDateFormat() Automatically convert the date format from PHP DateTime to Javascript DateTime format kartik\base\InputWidget
fixPjaxDuplication() Fix for weird PJAX container duplication behavior on pressing browser back and forward buttons. kartik\base\WidgetTrait
getBsExtBasename() The yii2-bootstrap extension base name. kartik\base\BootstrapTrait
getField() Gets the active field instance for the configured editable input kartik\editable\Editable
getInput() Generates an input. kartik\base\InputWidget
getOutput() Generates the widget output markup kartik\editable\Editable
getPluginScript() Returns the plugin registration script. kartik\base\WidgetTrait
hasModel() yii\widgets\InputWidget
hashPluginOptions() Generates a hashed variable to store the pluginOptions. kartik\base\WidgetTrait
initBsVersion() Initializes bootstrap versions for the widgets and asset bundles. kartik\base\BootstrapTrait
initDestroyJs() Generates the pluginDestroyJs script if it is not set. kartik\base\WidgetTrait
initDisability() Validates and sets disabled or readonly inputs. kartik\base\InputWidget
initEditable() Initializes the widget kartik\editable\Editable
initIcons() Initialize default icons kartik\editable\Editable
initInlineOptions() Initializes the inline settings & options. kartik\editable\Editable
initInputWidget() Initializes the input widget. kartik\base\InputWidget
initLanguage() Initialize the plugin language. kartik\base\InputWidget
initOptions() Initializes the widget options. This method sets the default values for various widget options. kartik\editable\Editable
isSameVersion() Compares two versions and checks if they are of the same major BS version. kartik\base\BootstrapTrait
mergeDefaultOptions() Merge default options kartik\base\WidgetTrait
parseDateFormat() Parses and sets plugin date format based on attribute type using yii\helpers\FormatConverter. Currently this method is used only within the kartik\date\DatePicker and \kartik\datetime\DateTimePicker\ widgets. kartik\base\InputWidget
parseTemplate() Parses the inline template and returns the generated content kartik\editable\Editable
parseVer() Parses and returns the major BS version kartik\base\BootstrapTrait
registerPlugin() Registers a specific plugin and the related events kartik\base\WidgetTrait
registerPluginOptions() Registers plugin options by storing within a uniquely generated javascript variable. kartik\base\WidgetTrait
renderActionButtons() Generates the editable action buttons kartik\editable\Editable
renderFooter() Generates the popover footer kartik\editable\Editable
renderFormFields() Renders the editable form fields kartik\editable\Editable
renderHtml5Input() Renders the HTML 5 input kartik\editable\Editable
renderInput() Renders all native HTML inputs (except INPUT_HTML5) kartik\editable\Editable
renderInputHtml() Render a HTML input tag. yii\widgets\InputWidget
renderToggleButton() Renders the toggle button kartik\editable\Editable
renderWidget() Renders a widget kartik\editable\Editable
runEditable() Runs the editable widget kartik\editable\Editable
setDataVar() Sets a HTML5 data variable. kartik\base\WidgetTrait
setLanguage() Sets the language JS file if it exists. kartik\base\InputWidget

Events

Hide inherited events

EventTypeDescriptionDefined By
EVENT_AFTER_RUN yii\base\WidgetEvent An event raised right after executing a widget. (available since version 2.0.11) yii\base\Widget
EVENT_BEFORE_RUN yii\base\WidgetEvent An event raised right before executing a widget. (available since version 2.0.11) yii\base\Widget
EVENT_INIT yii\base\Event An event that is triggered when the widget is initialized via init(). (available since version 2.0.11) yii\base\Widget

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
CSS_PARENT "kv-editable-parent form-group" CSS setting for the editable parent kartik\editable\Editable
FORMAT_BUTTON 'button' Editable BUTTON display format kartik\editable\Editable
INLINE_AFTER_1 Editable prebuilt inline template number 1 for content after kartik\editable\Editable
INLINE_AFTER_2 Editable prebuilt inline template number 2 for content after kartik\editable\Editable
INLINE_BEFORE_1 kartik\editable\Editable
INLINE_BEFORE_2 Editable prebuilt inline template number 2 for content before kartik\editable\Editable
INPUT_CHECKBOX 'checkbox' Checkbox input kartik\editable\Editable
INPUT_CHECKBOX_BUTTON_GROUP 'checkboxButtonGroup' Bootstrap styled checkbox button group kartik\editable\Editable
INPUT_CHECKBOX_LIST 'checkboxList' Checkbox inputs as a list allowing multiple selection kartik\editable\Editable
INPUT_CHECKBOX_X '\kartik\checkbox\CheckboxX' Krajee checkbox extended input widget kartik\checkbox\CheckboxX kartik\editable\Editable
INPUT_COLOR '\kartik\color\ColorInput' Krajee color input widget kartik\color\ColorInput kartik\editable\Editable
INPUT_DATE '\kartik\date\DatePicker' Krajee date picker input widget kartik\date\DatePicker kartik\editable\Editable
INPUT_DATETIME '\kartik\datetime\DateTimePicker' Krajee date time Picker input widget kartik\datetime\DateTimePicker kartik\editable\Editable
INPUT_DATE_RANGE '\kartik\daterange\DateRangePicker' Krajee date range picker input widget kartik\daterange\DateRangePicker kartik\editable\Editable
INPUT_DEPDROP '\kartik\depdrop\DepDrop' Krajee dependent dropdown input widget kartik\depdrop\DepDrop kartik\editable\Editable
INPUT_DROPDOWN_LIST 'dropDownList' Dropdown list allowing single select kartik\editable\Editable
INPUT_FILE 'fileInput' File input kartik\editable\Editable
INPUT_FILEINPUT '\kartik\file\FileInput' Krajee file input widget kartik\file\FileInput kartik\editable\Editable
INPUT_HIDDEN 'hiddenInput' Hidden input kartik\editable\Editable
INPUT_HTML5 'input' Other HTML5 input (e.g. color, range, email etc.) kartik\editable\Editable
INPUT_LIST_BOX 'listBox' List box allowing multiple select kartik\editable\Editable
INPUT_MONEY '\kartik\money\MaskMoney' Krajee mask money input widget kartik\money\MaskMoney kartik\editable\Editable
INPUT_MULTISELECT 'multiselect' Krajee styled multiselect input that allows formatted checkbox list and radio list kartik\editable\Editable
INPUT_PASSWORD 'passwordInput' Password input kartik\editable\Editable
INPUT_RADIO 'radio' Radio input kartik\editable\Editable
INPUT_RADIO_BUTTON_GROUP 'radioButtonGroup' Bootstrap styled radio button group kartik\editable\Editable
INPUT_RADIO_LIST 'radioList' Radio inputs as a list kartik\editable\Editable
INPUT_RANGE '\kartik\range\RangeInput' Krajee range input widget kartik\range\RangeInput kartik\editable\Editable
INPUT_RATING '\kartik\rating\StarRating' Krajee star rating input widget kartik\rating\StarRating kartik\editable\Editable
INPUT_SELECT2 '\kartik\select2\Select2' Krajee select2 input widget kartik\select2\Select2 kartik\editable\Editable
INPUT_SLIDER '\kartik\slider\Slider' Krajee slider input widget kartik\slider\Slider kartik\editable\Editable
INPUT_SORTABLE '\kartik\sortinput\SortableInput' Krajee sortable input widget kartik\sortinput\SortableInput kartik\editable\Editable
INPUT_SPIN '\kartik\touchspin\TouchSpin' Krajee touch spin input widget kartik\touchspin\TouchSpin kartik\editable\Editable
INPUT_SWITCH '\kartik\switchinput\SwitchInput' Krajee switch input widget kartik\switchinput\SwitchInput kartik\editable\Editable
INPUT_TEXT 'textInput' Text input kartik\editable\Editable
INPUT_TEXTAREA 'textArea' Text area kartik\editable\Editable
INPUT_TIME '\kartik\time\TimePicker' Krajee Time picker input widget kartik\time\TimePicker kartik\editable\Editable
INPUT_TYPEAHEAD '\kartik\typeahead\Typeahead' Krajee typeahead input widget kartik\typeahead\Typeahead kartik\editable\Editable
INPUT_WIDGET 'widget' Input widget kartik\editable\Editable
LOAD_INDICATOR '' Loading indicator markup for the editable kartik\editable\Editable
LOAD_PROGRESS '
 
'
kartik\base\InputWidget

Property Details

$_form protected property

Active form instance

protected yii\widgets\ActiveForm $_form null
$_icons protected static property

Configuration of icons for BS3 and BS4

protected static array $_icons = [
    'defaultEditableBtnIcon' => ['pencil''pencil-alt'], 'defaultSubmitBtnIcon' => ['ok''check'], 'defaultResetBtnIcon' => ['ban-circle''ban'], 'defaultPreHeaderIcon' => ['edit''edit']
]
$_inputOptions protected property

The HTML attributes or options for the input/widget

protected array $_inputOptions = []
$_msgCat protected property

The i18n message category

protected string $_msgCat 'kveditable'
$_popoverOptions protected property

The generated configuration for the kartik\popover\PopoverX widget.

protected array $_popoverOptions = []
$additionalData public property

Additional data to be passed when editable is submitted via ajax request as $key => $value pairs. This will generate hidden inputs in the editable form with input name as $key and input value as $value.

public array $additionalData = []
$afterInput public property

The content to be placed after the rendered input. If not set as a string, this can be passed as a callback function of the following signature: function ($form, $widget) { // echo $form->field($widget->model, 'attrib'); }

where:

  • $form: ActiveForm, is the active form instance for the editable form
  • $widget: Editable, is the current editable widget instance
public string|Closure $afterInput null
$ajaxSettings public property

Additional ajax settings to pass to the plugin.

See also http://api.jquery.com/jquery.

public boolean $ajaxSettings = []
$animationDelay public property

Editable fade animation delay (in micro-seconds). If entered as a string, it can be one of 'slow' or 'fast'.

See also http://api.jquery.com/fadein/.

$asPopover public property

Whether to show the editable input as a popover. Defaults to true. If set to false, it will be rendered inline.

public boolean $asPopover true
$beforeInput public property

The content to be placed before the rendered input. If not set as a string, this can be passed as a callback function of the following signature:

function ($form, $widget) {
   // echo $form->field($widget->model, 'attrib');
}

where:

  • $form: ActiveForm, is the active form instance for the editable form
  • $widget: Editable, is the current editable widget instance
public string|Closure $beforeInput null
$buttonsTemplate public property

The template for rendering the buttons

public string $buttonsTemplate "{reset}{submit}"
$closeOnBlur public property

Whether to close the editable form when it loses focus.

public boolean $closeOnBlur false
$containerOptions public property

The HTML attributes for the editable container

$contentOptions public property

The HTML attributes for the container enclosing the main content in the popover dialog.

public array $contentOptions = []
$defaultEditableBtnIcon public property

The default icon for editable button set as the label in $editableButtonOptions. Defaults to <i class="glyphicon glyphicon-pencil"></i> for [[bsVersion]] = '3.x' and for $bsVersion = '4.x'

$defaultPreHeaderIcon public property

The default icon for editable button used in the $preHeader. Defaults to: <i class="glyphicon glyphicon-edit"></i> for $bsVersion = '3.x' and <i class="fas fa-edit"></i> Edit for $bsVersion = '4.x'

$defaultResetBtnIcon public property

The default icon for editable button used in the $preHeader. Defaults to: <i class="glyphicon glyphicon-ban-circle"></i> for $bsVersion = '3.x' and <i class="fas fa-ban"></i> for $bsVersion = '4.x'

$defaultSubmitBtnIcon public property

The default icon for editable button used in the $preHeader. Defaults to: <i class="glyphicon glyphicon-ok"></i> for $bsVersion = '3.x' and <i class="fas fa-check"></i> for $bsVersion = '4.x'

$displayValue public property

The value to be displayed. If not set, this will default to the attribute value. If the attribute value is null, then this will display the value as set in $valueIfNull.

public string $displayValue null
$displayValueConfig public property

The configuration to auto-calculate display value, based on the value of the editable input. This should be a single dimensional array whose keys must match the input value, and the array values must be the description to be displayed. For example, to display user friendly bool values, you could configure this as [0 => 'Inactive', 1 => 'Active']. If this is set, it will override any value set in displayValue.

$editableButtonOptions public property

The HTML attributes for the editable button to be displayed when the format has been set to 'button':

$editableValueOptions public property

The HTML attributes for the editable value displayed

$encodeOutput public property

Whether to HTML encode the output via javascript after editable update. Defaults to true. Note that this is only applied, if you do not return an output value via your AJAX response action. If you return an output value via AJAX it will not be HTML encoded.

public boolean $encodeOutput true
$footer public property

The footer content in the popover dialog or inline panel. The following special tags/variables will be parsed and replaced in the footer:

  • {loading}: string, will be replaced with the loading indicator.
  • {buttons}: string, will be replaced with the submit and reset button. If this is set to null or an empty string, it will not be displayed.
public string $footer '{loading}{buttons}'
$form public read-only property
$formClass public property

The class for the ActiveForm widget to be used. The class must extend from \yii\widgets\ActiveForm. This defaults to \kartik\form\ActiveForm.

public array $formClass '\kartik\form\ActiveForm'
$formOptions public property

The options for the ActiveForm widget class selected in formClass.

public array $formOptions = []
$format public property

The display format for the editable. Accepts one of the following values.

public string $format self::FORMAT_LINK
$header public property

The header content in the popover dialog or inline panel. If not set, this will be auto generated based on the attribute label or set to null.

public string $header null
$inlineSettings public property

The settings for the inline editable when $asPopover is false. The following properties are recognized:

  • options: array, the HTML attributes for the div panel container that will enclose the inline content. By default the options will be set to ['class' => 'card panel panel-default'].
  • closeButton: string, the markup for rendering the close button to close the inline panel. Note the markup must have the CSS class kv-editable-close to trigger the closure of the inline panel. The closeButton defaults to <button class="kv-editable-close close">&times;</button>.
  • templateBefore: string, the template for inline content rendered before the input. Defaults to INLINE_BEFORE_1.
  • templateAfter: string, he template for inline content rendered after the input. Defaults to INLINE_AFTER_1. The following tokens in the templates above will be automatically replaced:
    • '{header}': the header generated via preHeader and header properties.
    • '{inputs}': the main form input content (combining beforeInput, the input/widget generated based on inputType, and afterInput)
    • '{buttons}': the form action buttons (submit and reset).
    • '{loading}': the loading indicator.
    • '{close}': the close button to close the inline content as set in inlineSettings['closeButton'].
public array $inlineSettings = []
$inputContainerOptions public property

The HTML attributes for the input container applicable only when not using with ActiveForm

$inputFieldConfig public property

The ActiveField configuration, if you are using with model.

$inputType public property

The input type to render for the editing the input in the editable form. This must be one of the Editable::TYPE constants.

public array $inputType self::INPUT_TEXT
$options public property

The options for the input. If the inputType is one of the HTML inputs, this will capture the HTML attributes. If the inputType is set to INPUT_WIDGET or set to an input widget from the \kartik\ namespace, then this will capture the widget options.

public array $options = []
$pjaxContainerId public property

The identifier for the PJAX widget container if the editable widget is to be rendered inside a PJAX container. This will ensure the PopoverX plugin is initialized correctly after a PJAX request is completed. If this is not set, no re-initialization will be done for pjax.

public string $pjaxContainerId null
$placement public property

The popover placement. Must be one of the PopoverX::ALIGN constants Defaults to kartik\popover\PopoverX::ALIGN_RIGHT or right. This will be applied only if $asPopover is true.

public string $placement = \kartik\popover\PopoverX::ALIGN_RIGHT
$preHeader public property

The header content placed before the header text in the popover dialog or inline panel. This defaults to: '{icon} Edit' - where {icon} is the $defaultPreHeaderIcon markup.

public string $preHeader null
$resetButton public property

The HTML attributes for the form reset button. The following special properties are additionally recognized:

  • icon: string, the icon for the button. Defaults to $defaultResetBtnIcon
  • label: string, the label of the button. This is HTML encoded. Defaults to Reset and is translated via yii i18n message files.
public array $resetButton = []
$resetDelay public property

Editable reset delay (in micro-seconds).

public integer $resetDelay 200
$selectAllOnEdit public property

Whether to select all text in the input when editable is opened.

public boolean $selectAllOnEdit true
$showAjaxErrors public property

Whether to display any ajax processing errors. Defaults to true.

public boolean $showAjaxErrors true
$showButtonLabels public property

Whether you want to show the button labels. Defaults to false.

public boolean $showButtonLabels false
$showButtons public property

Whether you wish to automatically display the form submit and reset buttons. Defaults to true.

public boolean $showButtons true
$size public property

The size of the popover window. One of the PopoverX::SIZE constants. This will be applied only if $asPopover is true.

public string $size null
$submitButton public property

The HTML attributes for the form submit button. The following special properties are additionally recognized:

  • icon: string, the icon for the button. Defaults to $defaultSubmitBtnIcon.
  • label: string, the label of the button. This is HTML encoded. Defaults to Apply and is translated via yii i18n message files.
public array $submitButton = [
    'class' => 'btn btn-sm btn-primary'
]
$submitOnEnter public property

Whether to auto submit/save the form on pressing ENTER key.

public boolean $submitOnEnter true
$type public property

The popover contextual type. Must be one of the PopoverX::TYPE constants Defaults to kartik\popover\PopoverX::TYPE_DEFAULT or default. This will be applied only if $asPopover is true.

public string $type = \kartik\popover\PopoverX::TYPE_DEFAULT
$validationDelay public property

Editable submission validation delay (in micro-seconds).

$valueIfNull public property

The value to display if the displayValue is null. Defaults to '(not set)'.

public string $valueIfNull null
$widgetClass public property

Any custom widget class to use. Will only be used if the inputType is set to INPUT_WIDGET

public string $widgetClass null

Method Details

getField() protected method

Gets the active field instance for the configured editable input

protected yii\widgets\ActiveField getField ( $label false )
$label boolean|string

The label for the field

getForm() public method

Gets the form instance for use at runtime

public yii\widgets\ActiveForm getForm ( )
getOutput() protected method

Generates the widget output markup

protected string getOutput ( $content )
$content string

The content to render

init() public method

Initializes the widget.

If you override this method, make sure you call the parent implementation first.

public void init ( )
throws yii\base\InvalidConfigException
throws ReflectionException
initEditable() protected method

Initializes the widget

protected void initEditable ( )
initIcons() protected method

Initialize default icons

protected void initIcons ( )
throws \yii\base\InvalidConfigException|\Exception
initInlineOptions() protected method

Initializes the inline settings & options.

protected void initInlineOptions ( )
initOptions() protected method

Initializes the widget options. This method sets the default values for various widget options.

protected void initOptions ( )
throws yii\base\InvalidConfigException
parseTemplate() protected method

Parses the inline template and returns the generated content

protected string parseTemplate ( $template )
$template string

The template setting

registerAssets() public method

Registers the client assets for kartik\editable\Editable widget.

public void registerAssets ( )
renderActionButtons() protected method

Generates the editable action buttons

protected string renderActionButtons ( )
renderFooter() protected method

Generates the popover footer

protected string renderFooter ( )
renderFormFields() protected method

Renders the editable form fields

protected void renderFormFields ( )
renderHtml5Input() protected method

Renders the HTML 5 input

protected string renderHtml5Input ( )
renderInput() protected method

Renders all native HTML inputs (except INPUT_HTML5)

protected string renderInput ( )
renderToggleButton() protected method

Renders the toggle button

protected string renderToggleButton ( )
renderWidget() protected method

Renders a widget

protected string renderWidget ( $class )
$class string

The input widget class name

throws Exception
run() public method

Executes the widget.

public string|void run ( )
return string|void

The rendering result may be directly "echoed" or returned as a string

runEditable() protected method

Runs the editable widget

protected void runEditable ( )