當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CFormElement::__construct方法代碼示例

本文整理匯總了PHP中CFormElement::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP CFormElement::__construct方法的具體用法?PHP CFormElement::__construct怎麽用?PHP CFormElement::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CFormElement的用法示例。


在下文中一共展示了CFormElement::__construct方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($config, $parent = null)
 {
     if ($parent == null) {
         $parent = Yii::app()->controller;
     }
     parent::__construct($config, $parent);
 }
開發者ID:tymiles003,項目名稱:X2CRM,代碼行數:7,代碼來源:FontPickerInput.php

示例2: __construct

 /**
  * Constructor
  *
  * @param string $name       of the element.
  * @param array  $attributes to set to the element. Default is an empty array.
  *
  * @return void
  */
 public function __construct($name, $attributes = [])
 {
     parent::__construct($name, $attributes);
     $this['type'] = 'radio';
     //$this['checked']  = isset($attributes['checked']) ? $attributes['checked'] : false;
     //$this['value']    = isset($attributes['value']) ? $attributes['value'] : $name;
 }
開發者ID:Kajja,項目名稱:phpmvc,代碼行數:15,代碼來源:CFormElementRadio.php

示例3: __construct

 /**
  * Constructor
  *
  * @param string $name       of the element.
  * @param array  $attributes to set to the element. Default is an empty array.
  *
  * @return void
  */
 public function __construct($name, $attributes = [])
 {
     parent::__construct($name, $attributes);
     $this['type'] = 'checkbox';
     $this['checked'] = isset($attributes['checked']) ? $attributes['checked'] : false;
     $this['value'] = isset($attributes['value']) ? $attributes['value'] : $name;
     $this->UseNameAsDefaultLabel(null);
 }
開發者ID:Kajja,項目名稱:phpmvc,代碼行數:16,代碼來源:CFormElementCheckbox.php

示例4: __construct

 /**
  * Constructor
  *
  * @param string $name       of the element.
  * @param array  $attributes to set to the element. Default is an empty array.
  *
  * @throws CFormException if missing <options>
  */
 public function __construct($name, $attributes = [])
 {
     parent::__construct($name, $attributes);
     $this['type'] = 'select';
     $this->UseNameAsDefaultLabel();
     if (!is_array($this['options'])) {
         throw new CFormException("Select needs options, did you forget to specify them when creating the element?");
     }
 }
開發者ID:stjo15,項目名稱:janax,代碼行數:17,代碼來源:CFormElementSelect.php

示例5: __construct

 /**
  * Constructor.
  * If you override this method, make sure you do not modify the method
  * signature, and also make sure you call the parent implementation.
  * @param mixed $config the configuration for this form. It can be a configuration array
  * or the path alias of a PHP script file that returns a configuration array.
  * The configuration array consists of name-value pairs that are used to initialize
  * the properties of this form.
  * @param CModel $model the model object associated with this form. If it is null,
  * the parent's model will be used instead.
  * @param mixed $parent the direct parent of this form. This could be either a {@link CBaseController}
  * object (a controller or a widget), or a {@link CForm} object.
  * If the former, it means the form is a top-level form; if the latter, it means this form is a sub-form.
  */
 public function __construct($config, $model = null, $parent = null)
 {
     $this->setModel($model);
     if ($parent === null) {
         $parent = Yii::app()->getController();
     }
     parent::__construct($config, $parent);
     $this->init();
 }
開發者ID:lucifurious,項目名稱:yii,代碼行數:23,代碼來源:CForm.php

示例6: __construct

 /**
  * Constructor
  *
  * @param string $name       of the element.
  * @param array  $attributes to set to the element. Default is an empty array.
  */
 public function __construct($name, $attributes = [])
 {
     parent::__construct($name, $attributes);
     $this['type'] = 'tel';
     $this->UseNameAsDefaultLabel();
 }
開發者ID:stjo15,項目名稱:janax,代碼行數:12,代碼來源:CFormElementTel.php

示例7: __construct

 /**
  * Constructor
  *
  * @param string name of the element.
  * @param array attributes to set to the element. Default is an empty array.
  */
 public function __construct($name, $attributes = array())
 {
     parent::__construct($name, $attributes);
     $this['type'] = 'submit';
     $this->UseNameAsDefaultValue();
 }
開發者ID:fnlive,項目名稱:Anax-MVC,代碼行數:12,代碼來源:CForm.php

示例8: __construct

 /**
  * Constructor
  *
  * @param string name of the element.
  * @param array attributes to set to the element. Default is an empty array.
  */
 public function __construct($name, $attributes = array())
 {
     parent::__construct($name, $attributes);
     $this['space'] = 'space';
 }
開發者ID:Electrotest,項目名稱:BehovsBoBoxen,代碼行數:11,代碼來源:CForm.php

示例9: __construct

 /**
  * Constructor
  *
  * @param string $name       of the element.
  * @param array  $attributes to set to the element. Default is an empty array.
  */
 public function __construct($name, $attributes = [])
 {
     parent::__construct($name, $attributes);
     $this['type'] = 'search-widget';
 }
開發者ID:stjo15,項目名稱:janax,代碼行數:11,代碼來源:CFormElementSearchWidget.php

示例10: __construct

 /**
  * Constructor
  *
  * @param string $name       of the element.
  * @param array  $attributes to set to the element. Default is an empty array.
  */
 public function __construct($name, $attributes = [])
 {
     parent::__construct($name, $attributes);
     $this['type'] = 'button';
     $this->UseNameAsDefaultValue();
 }
開發者ID:stjo15,項目名稱:janax,代碼行數:12,代碼來源:CFormElementButton.php


注:本文中的CFormElement::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。