当前位置: 首页>>代码示例>>PHP>>正文


PHP CActiveForm::init方法代码示例

本文整理汇总了PHP中CActiveForm::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveForm::init方法的具体用法?PHP CActiveForm::init怎么用?PHP CActiveForm::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CActiveForm的用法示例。


在下文中一共展示了CActiveForm::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     // Set input container for error class addition when validation fails
     if (isset($this->clientOptions)) {
         if (!isset($this->clientOptions['inputContainer'])) {
             $this->clientOptions['inputContainer'] = '.control-group';
         }
     } else {
         $this->clientOptions = array('inputContainer' => '.control-group');
     }
     // Set default for class
     if (!isset($this->type) || !in_array($this->type, array('vertical', 'inline', 'search', 'horizontal'))) {
         $this->type = 'horizontal';
     }
     $class = 'form-' . $this->type;
     if (isset($this->htmlOptions)) {
         if (!isset($this->htmlOptions['class'])) {
             $this->htmlOptions['class'] = $class;
         } else {
             $this->htmlOptions['class'] .= ' ' . $class;
         }
     } else {
         $this->htmlOptions = array('class' => $class);
     }
     // then do($magic)
     parent::init();
 }
开发者ID:rzamarripa,项目名称:masoftproyectos,代码行数:27,代码来源:BActiveForm.php

示例2: init

 public function init()
 {
     if (!$this->action && Yii::app()->params->isPhoneGap) {
         $this->action = AuxLib::getRequestUrl();
     }
     return parent::init();
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:7,代码来源:MobileActiveForm.php

示例3: init

    public function init()
    {
        parent::init();

        if ($this->enableSaveToLocalStorage) {
            $this->registerClientScript();
        }
    }
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:8,代码来源:LocalStorageActiveForm.php

示例4: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     if (!in_array($this->type, array(TbHtml::FORM_HORIZONTAL, TbHtml::FORM_INLINE, TbHtml::FORM_VERTICAL))) {
         $this->type = TbHtml::FORM_VERTICAL;
     }
     $this->htmlOptions = TbHtml::addClassName('form-' . $this->type, $this->htmlOptions);
     if (null === $this->helpType) {
         $this->helpType = $this->type == TbHtml::FORM_HORIZONTAL ? TbHtml::HELP_INLINE : TbHtml::HELP_BLOCK;
     }
     parent::init();
 }
开发者ID:yii-twbs,项目名称:yiistrap,代码行数:14,代码来源:TbActiveForm.php

示例5: init

    /**
     * Initializes the widget.
     * This renders the form open tag.
     */
    public function init()
    {
        echo <<<EOD
<div class="form gii2">
\t<p class="note">
\t\tFields with <span class="required">*</span> are required.
\t\tClick on the <span class="sticky">highlighted fields</span> to edit them.
\t</p>
EOD;
        parent::init();
    }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:15,代码来源:BaseGiiEventTypeCActiveForm.php

示例6: init

 /**
  * Init the widget .
  *
  * @access public
  * @return void
  */
 public function init()
 {
     if ($this->horizontal) {
         EBootstrap::mergeClass($this->htmlOptions, array('form-horizontal'));
     }
     if ($this->cssFile === false) {
         $cssFile = dirname(__FILE__) . '/css/bootstrap.css';
         $this->cssFile = Yii::app()->getAssetManager()->publish($cssFile);
         Yii::app()->clientScript->registerCssFile($this->cssFile);
     }
     parent::init();
 }
开发者ID:raphaelrocha,项目名称:mtcontrool_mtcontext,代码行数:18,代码来源:EBootstrapActiveForm.php

示例7: init

 /**
  * Initializes the widget.
  * This renders the form open tag.
  */
 public function init()
 {
     if (!isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] = 'form-' . $this->type;
     } else {
         $this->htmlOptions['class'] .= ' form-' . $this->type;
     }
     if ($this->inlineErrors) {
         $this->errorMessageCssClass = 'help-inline';
     } else {
         $this->errorMessageCssClass = 'help-block';
     }
     parent::init();
 }
开发者ID:niranjan2m,项目名称:Voyanga,代码行数:18,代码来源:BootActiveForm.php

示例8: init

 /**
  * Initializes the widget.
  * This renders the form open tag.
  */
 public function init()
 {
     $cssClass = $this->stacked ? 'form-stacked' : '';
     if (!isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] = $cssClass;
     } else {
         $this->htmlOptions['class'] .= ' ' . $cssClass;
     }
     if ($this->errorMessageType === 'inline') {
         $this->errorMessageCssClass = 'help-inline';
     } else {
         $this->errorMessageCssClass = 'help-block';
     }
     parent::init();
 }
开发者ID:vangogogo,项目名称:justsns,代码行数:19,代码来源:BootActiveForm.php

示例9: init

    /**
     * Initializes the widget.
     */
    public function init()
    {
        $script = <<<SCRIPT
\t\$('#{$this->id} .{$this->containerCssClass} :radio:not(:checked)').siblings('.{$this->contentCssClass}').hide();
\t\$('#{$this->id} .{$this->containerCssClass} :radio').click(function(){
\t\t\$('.{$this->contentCssClass}', \$(this).parents('div:first')).css('display', this.checked ? 'inline':'none');
\t\t\$('#{$this->id} .{$this->containerCssClass} :radio:not(:checked)').siblings('.{$this->contentCssClass}').hide();
\t});
\t\$('#{$this->id} .{$this->containerCssClass} :checkbox:not(:checked)').siblings('.{$this->contentCssClass}').hide();
\t\$('#{$this->id} .{$this->containerCssClass} :checkbox').click(function(){
\t\t\$('.{$this->contentCssClass}', \$(this).parents('div:first')).css('display', this.checked ? 'block':'none');
\t});
SCRIPT;
        Yii::app()->clientScript->registerScript(__CLASS__ . '#' . $this->id, $script, CClientScript::POS_READY);
        parent::init();
    }
开发者ID:mryuhancai,项目名称:newphemu,代码行数:19,代码来源:XDynamicForm.php

示例10: init

 /**
  *### .init()
  * Initializes the widget.
  * This renders the form open tag.
  */
 public function init()
 {
     if (!isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] = 'form-' . $this->type;
     } else {
         $this->htmlOptions['class'] .= ' form-' . $this->type;
     }
     if (!isset($this->inlineErrors)) {
         $this->inlineErrors = $this->type === self::TYPE_HORIZONTAL;
     }
     if ($this->inlineErrors) {
         $this->errorMessageCssClass = 'help-inline error';
     } else {
         $this->errorMessageCssClass = 'help-block error';
     }
     parent::init();
 }
开发者ID:robebeye,项目名称:isims,代码行数:22,代码来源:TbActiveForm.php

示例11: init

 public function init()
 {
     Yii::app()->clientScript->registerPackage('jquery.ui');
     Yii::app()->clientScript->registerPackage('jquery');
     Yii::app()->clientScript->registerPackage('cookie');
     Yii::app()->clientScript->registerScript('modelData', 'var modelData = ' . json_encode($this->model->toArray()) . ';', CClientScript::POS_HEAD);
     $assets = Yii::app()->getAssetManager()->publish(dirname(__FILE__) . '/assets');
     Yii::app()->clientScript->registerScriptFile($assets . '/js/modelForm.js', CClientScript::POS_END);
     if (!$this->fromModel && $this->model instanceof IFileBased) {
         echo $this->upload('id');
     }
     if (!$this->fromModel) {
         $this->htmlOptions['onsubmit'] = 'return modelFormSubmit();';
     }
     $this->htmlOptions['isNew'] = (int) (!$this->model->id);
     $this->htmlOptions['class'] = 'modelForm';
     parent::init();
 }
开发者ID:schyzoo,项目名称:YiiBoilerplate,代码行数:18,代码来源:ModelForm.php

示例12: init

 /**
  * Initializes the widget.
  * This renders the form open tag.
  */
 public function init()
 {
     if (!isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] = 'form-' . $this->type;
     } else {
         $this->htmlOptions['class'] .= ' form-' . $this->type;
     }
     if (!isset($this->inlineErrors)) {
         $this->inlineErrors = $this->type === self::TYPE_HORIZONTAL;
     }
     if (!isset($this->errorField)) {
         self::$showError = $this->errorField;
     }
     if ($this->inlineErrors) {
         $this->errorMessageCssClass = 'help-inline error';
     } else {
         $this->errorMessageCssClass = 'help-block has-error';
     }
     if ($this->enter2tab) {
         $this->enterToTab();
     }
     $this->htmlOptions['role'] = "form";
     parent::init();
 }
开发者ID:piond,项目名称:new_rsud,代码行数:28,代码来源:TbActiveForm.php

示例13: init

 public function init()
 {
     $this->id = $this->resolveId($this->id);
     parent::init();
 }
开发者ID:keyeMyria,项目名称:CRM,代码行数:5,代码来源:X2ActiveForm.php

示例14: init

 /**
  * Registers clientscripts for radio and checkbox if needed
  */
 public function init()
 {
     if ($this->enableRadioToggle) {
         $this->registerRadioClientScript();
     }
     if ($this->enableChecboxToggle) {
         $this->registerCheckboxClientScript();
     }
     parent::init();
 }
开发者ID:rizaldi-github,项目名称:Yii-Playground,代码行数:13,代码来源:XDynamicForm.php

示例15: init

 /**
  * Init the form widget
  */
 public function init()
 {
     if ($this->layout !== 'standard') {
         $class = 'form-' . $this->layout;
         if (isset($this->htmlOptions['class'])) {
             $this->htmlOptions['class'] .= " {$class}";
         } else {
             $this->htmlOptions['class'] = $class;
         }
     }
     parent::init();
 }
开发者ID:codemix,项目名称:bs3activeform,代码行数:15,代码来源:BS3ActiveForm.php


注:本文中的CActiveForm::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。