public static function textField($name, $value = '', $htmlOptions = array()) { return self::textInputField('text', $name, $value, $htmlOptions); }
/** * Runs the widget. */ public function run() { list($name, $id) = $this->resolveNameID(); $id = $this->resolveId($id); if ($this->hasModel()) { echo TbHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions); } else { echo TbHtml::textField($name, $this->value, $this->htmlOptions); } if ($this->assetPath !== false) { $this->publishAssets($this->assetPath); $this->registerCssFile('/css/bootstrap-datetimepicker.css'); if ($this->registerJs) { $this->registerScriptFile('/js/' . $this->resolveScriptVersion('bootstrap-datetimepicker.js'), CClientScript::POS_END); if (isset($this->locale)) { $this->locale = str_replace('_', '-', $this->locale); $this->registerScriptFile("/js/locales/bootstrap-datetimepicker.{$this->locale}.js", CClientScript::POS_END); } } } if ($this->bindPlugin) { $options = !empty($this->pluginOptions) ? CJavaScript::encode($this->pluginOptions) : ''; $this->getClientScript()->registerScript(__CLASS__ . '#' . $id, "jQuery('#{$id}').datetimepicker({$options});"); } }