예제 #1
0
 public function __construct($config, $parent = null)
 {
     if ($parent == null) {
         $parent = Yii::app()->controller;
     }
     parent::__construct($config, $parent);
 }
예제 #2
0
 /**
  * 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;
 }
예제 #3
0
 /**
  * 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);
 }
예제 #4
0
 /**
  * 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?");
     }
 }
예제 #5
0
파일: CForm.php 프로젝트: lucifurious/yii
 /**
  * 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();
 }
예제 #6
0
 /**
  * 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();
 }
예제 #7
0
 /**
  * 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'] = 'hidden';
 }
예제 #8
0
파일: CForm.php 프로젝트: fnlive/Anax-MVC
 /**
  * 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();
 }
예제 #9
0
 /**
  * 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-multiple';
 }
예제 #10
0
 /**
  * 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';
 }
예제 #11
0
 /**
  * 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';
 }
예제 #12
0
 /**
  * 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();
 }