Thursday 5 April 2012

Yii Framework change the default action for a specific controller

Yii Framework: Change the default action for a specific controller

Simply set the public variable $defaultAction in your controller.

e.g.,


class XXXXController extends Controller
{
       public $defaultAction = 'DefaultAction';


        public function actionDefaultAction()
{
              XXXXXXXXXXXXXXXXXXXX
        }
}

Then, when you visit yourwebsite/index.php/XXXX, the DefaultAction will be executed!

For more:

http://www.yiiframework.com/forum/index.php/topic/5372-change-default-controller-action/



帮自己宣传一下刚上线的网站 梦奇网;目前的提供的服务是 签证搜索 和 时间和日期。谢谢大家支持,SEO下!

No comments:

Post a Comment