\AttrController

Controller is the customized base controller class.

All controller classes for this application should extend from this base class.

Summary

Methods
Properties
Constants
init()
filters()
accessRules()
actionView()
actionCreate()
actionUpdate()
actionDelete()
actionIndex()
actionAdmin()
loadModel()
$layout
$menu
$breadcrumbs
No constants found
hasAccess()
performAjaxValidation()
$mainMenu
$subMenu
$mainEMenu
$subEMenu
N/A
No private methods found
No private properties found
N/A

Properties

$layout

$layout : string

Type

string — the default layout for the views. Defaults to '//layouts/column2', meaning using two-column layout. See 'protected/views/layouts/column2.php'.

$menu

$menu : array

Type

array — context menu items. This property will be assigned to {@link CMenu::items}.

$breadcrumbs

$breadcrumbs : array

Type

array — the breadcrumbs of the current page. The value of this property will be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links} for more details on how to specify this property.

$mainMenu

$mainMenu : 

Type

$subMenu

$subMenu : 

Type

$mainEMenu

$mainEMenu : 

Type

$subEMenu

$subEMenu : 

Type

Methods

init()

init() 

filters()

filters() : array

Returns

array —

action filters

accessRules()

accessRules() : array

Specifies the access control rules.

This method is used by the 'accessControl' filter.

Returns

array —

access control rules

actionView()

actionView(integer  $id) 

Displays a particular model.

Parameters

integer $id

the ID of the model to be displayed

actionCreate()

actionCreate() 

Creates a new model.

If creation is successful, the browser will be redirected to the 'view' page.

actionUpdate()

actionUpdate(integer  $id) 

Updates a particular model.

If update is successful, the browser will be redirected to the 'view' page.

Parameters

integer $id

the ID of the model to be updated

actionDelete()

actionDelete(integer  $id) 

Deletes a particular model.

If deletion is successful, the browser will be redirected to the 'admin' page.

Parameters

integer $id

the ID of the model to be deleted

actionIndex()

actionIndex() 

Lists all models.

actionAdmin()

actionAdmin() 

Manages all models.

loadModel()

loadModel(integer  $id) : \Attr

Returns the data model based on the primary key given in the GET variable.

If the data model is not found, an HTTP exception will be raised.

Parameters

integer $id

the ID of the model to be loaded

Throws

\CHttpException

Returns

\Attr

the loaded model

hasAccess()

hasAccess(\CAction  $action) : boolean

Check whether user has access to action or not.

Parameters

\CAction $action

Returns

boolean —

true if has access

performAjaxValidation()

performAjaxValidation(\Attr  $model) 

Performs the AJAX validation.

Parameters

\Attr $model

the model to be validated