If you have a few static pages and aren't going to change them very frequently, then it's not worth querying the database and implementing page management for them.
CViewAction
to our controller.class SiteController extends CController { function actions() { return array( 'page'=>array( 'class'=>'CViewAction', ), ); } }
protected/views/site/pages
, and name them about.php
and contact.php
.http://example.com/index.php?r=site/page&view=contact
.http://example.com/site/page/view/about
, if you have configured clean URLs with a path format.We connect the external action named CViewAction
that simply tries to find a view named the same as the $_GET
parameter supplied. If it is there, it displays it. If not, then it will give you a 404 not found page.
There are some useful CViewAction
parameters we can use. These are listed in the following table:
For further information, refer to the following URL:
3.135.197.201