本文整理汇总了PHP中BsHtml::activeTelFieldControlGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP BsHtml::activeTelFieldControlGroup方法的具体用法?PHP BsHtml::activeTelFieldControlGroup怎么用?PHP BsHtml::activeTelFieldControlGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BsHtml
的用法示例。
在下文中一共展示了BsHtml::activeTelFieldControlGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
list($name, $id) = $this->resolveNameID();
if (isset($this->htmlOptions['id'])) {
$id = $this->htmlOptions['id'];
} else {
$this->htmlOptions['id'] = $this->hidden ? $id . '_hidden' : $id;
}
if (isset($this->htmlOptions['name'])) {
$name = $this->htmlOptions['name'];
} else {
$this->htmlOptions['name'] = $this->hidden ? $name . '_hidden' : $name;
}
if ($this->hasModel()) {
echo $this->hidden ? BsHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions) : BsHtml::activeTelFieldControlGroup($this->model, $this->attribute, $this->htmlOptions);
} else {
echo $this->hidden ? CHtml::hiddenField($name, $this->value, $this->htmlOptions) : CHtml::textField($name, $this->value, $this->htmlOptions);
}
$options = CJavaScript::encode($this->options);
$js = "jQuery('#{$id}').{$this->mode}picker({$options});";
if (isset($this->language)) {
$this->registerScriptFile($this->i18nScriptFile);
$js = "jQuery('#{$id}').{$this->mode}picker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['{$this->language}'], {$options}));";
}
$cs = Yii::app()->getClientScript();
$assets = Yii::app()->getAssetManager()->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets');
$cs->registerCssFile($assets . self::ASSETS_NAME . '.css');
$cs->registerScriptFile($assets . self::ASSETS_NAME . '.js', CClientScript::POS_END);
$cs->registerScript(__CLASS__, $this->defaultOptions ? 'jQuery.{$this->mode}picker.setDefaults(' . CJavaScript::encode($this->defaultOptions) . ');' : '');
$cs->registerScript(__CLASS__ . '#' . $id, $js);
}
示例2: telFieldControlGroup
/**
* Generates a control group with an telephone field for a model attribute.
* @param CModel $model the data model.
* @param string $attribute the attribute name.
* @param array $htmlOptions additional HTML attributes.
* @return string the generated row.
* @see BsHtml::activeTelFieldControlGroup
*/
public function telFieldControlGroup($model, $attribute, $htmlOptions = array())
{
$htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions);
return BsHtml::activeTelFieldControlGroup($model, $attribute, $htmlOptions);
}