Example #1
0
 public function checkBox($model, $attribute, $htmlOptions = array())
 {
     if ($model->isAttributeRequired($attribute)) {
         $htmlOptions['required'] = 'required';
     }
     return parent::checkBox($model, $attribute, $htmlOptions);
 }
Example #2
0
 /**
  * @inheritDoc
  */
 public function checkBox($model, $attribute, $htmlOptions = array())
 {
     if (!$this->qualifyNames && !isset($htmlOptions['name'])) {
         $htmlOptions['name'] = $attribute;
     }
     return parent::checkBox($model, $attribute, $htmlOptions);
 }
Example #3
0
 /**
  * Renders a checkbox for a model attribute.
  * @param CModel $parentModel the parent data model
  * @param string $attributedPath the attribute or path to related model attribute
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated check box
  */
 public function checkBox($parentModel, $attributedPath, $htmlOptions = array())
 {
     list($model, $attribute, $htmlOptions) = self::resolveArgs($parentModel, $attributedPath, $htmlOptions);
     return parent::checkBox($model, $attribute, $htmlOptions);
 }
Example #4
0
 public function check($attribute)
 {
     $html = parent::checkBox($this->model, $attribute);
     return $this->wrapField($html, $attribute);
 }