public function renderInput(CModel $model, $attribute, array $htmlOptions = array()) { $action = new Actions(); $action->setAttributes($model->getAttributes(), false); $defaultOptions = array('id' => $this->resolveId($attribute)); $htmlOptions = X2Html::mergeHtmlOptions($defaultOptions, $htmlOptions); return preg_replace('/Actions(\\[[^\\]]*\\])/', get_class($this->formModel) . '$1', $action->renderInput($attribute, $htmlOptions)); }
public function getAttributes($names = null) { if ($names == null) { return $this->_attributes; } else { parent::getAttributes($names); } }
/** * Returns all attribute values. * @param array $names list of attributes whose value needs to be returned. * Defaults to null, meaning all attributes as listed in {@link attributeNames} will be returned. * If it is an array, only the attributes in the array will be returned. * @param bool $includeId * @return array attribute values (name=>value). */ public function getAttributes($names = null, $includeId = true) { $prepared = []; if ($includeId) { $prepared['id'] = $this->id; } $attributes = parent::getAttributes($names); return array_merge($prepared, $attributes); }