public function checkBox($model, $attribute, $htmlOptions = array()) { if ($model->isAttributeRequired($attribute)) { $htmlOptions['required'] = 'required'; } return parent::checkBox($model, $attribute, $htmlOptions); }
/** * @inheritDoc */ public function checkBox($model, $attribute, $htmlOptions = array()) { if (!$this->qualifyNames && !isset($htmlOptions['name'])) { $htmlOptions['name'] = $attribute; } return parent::checkBox($model, $attribute, $htmlOptions); }
/** * 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); }
public function check($attribute) { $html = parent::checkBox($this->model, $attribute); return $this->wrapField($html, $attribute); }