/** * Renders a user roles view. * * @return string */ public static function userRolesOutput($model, $attribute) { $html = ''; $html .= '<div class="html-tree">'; $html .= AuthHelper::buildHtmlTree($model, $attribute, AuthHelper::getRoles()); $html .= '</div>'; return $html; }
/** * Renders a user roles input. * * @return $this the field object itself */ public function userRolesInput() { $input = ''; $input .= '<div class="html-tree">'; $input .= AuthHelper::buildHtmlTreeInput($this->model, $this->attribute, AuthHelper::getRoles()); $input .= '</div>'; $this->parts['{input}'] = $input; return $this; }