当前位置: 首页>>代码示例>>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;未经允许,请勿转载。