Setting Home Page In yii Application With Default Controller And Default Action ?

We can set or change front page or home page of YII Driven web Application with simple Changes, we can do this with changing a default controller and a default action.

Default Controller : Default Controller can be called , if no controller provided.

Default action: Default Action is controller method, which will be called by the system automatically if no action is provided while calling controller.

To change or set Default Controller in Yii, go to protected/config/main.php. replace ‘site'(Controller) with your controller

set default controller in yii

Changing Default Action: we can change default action in a controller by setting public property $defaultAction value. here is the code

set default controller Action in yii

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

Arjun
I am Arjun from Hyderabad (India). I have been working as a software engineer from last 7+ years, and its my passion to learn new things and implement them as a practice. Aside from work, I likes gardening and spending time with pets.
DMCA.com Protection Status