public function __construct($config, $parent = null) { if ($parent == null) { $parent = Yii::app()->controller; } parent::__construct($config, $parent); }
/** * 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; }
/** * 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); }
/** * 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?"); } }
/** * 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(); }
/** * 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(); }
/** * 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'; }
/** * 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(); }
/** * 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'; }
/** * 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'; }
/** * 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'; }
/** * 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(); }