2011-06-14 23:57:44 0 评论 Yii 1.0 Boy.Lee

beforeAction 示例代码

{Code}

public function beforeAction()
{
    if($this->action->id == 'index')
    { 
        //TODO
    }
}

{BoyLee Said}

这里展示了如何在actionIndex之前设置前置动作. 你也可以使用filter来实现相同的功能.

So I got this code from JianZhang's help, thanks again.