當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。