How to call CViewAction

From the Yii demo, I can see using the following code to attach the CViewAction plugin to a controller


  public function actions() { 

...      	// page action renders "static" pages stored under 'protected/views/site/pages'

			// They can be accessed via: index.php?r=site/page&view=FileName


            	'page'=>array(

				'class'=>'CViewAction',

			)

...}

After it’s attached. how do you use the ‘page’ action to display a static html page? Can you give me a code example? Thank you!

Do you want us to look up each function/class/whatever you post for you?

Or do you want to look it up yourself?

-> http://www.yiiframew…1/CViewAction/

CController actions() is explained here:

doc/guide/1.1/en/basics.controller#action

If my question is too easy that offends you, I am very sorry about it. I may miss something, and may ask questions which already has well documented answer. But I read the two links you provided again, and still couldn’t understand how to use ‘page’ action to display a static page.

Here it talks about GET, but I still have no clue how to display a static page.

There is NO example and I couldn’t understand the class reference without code example!

Have you take a look on a newly generated yii application? the "about us" its a static page, check that one and see if you get it from there.

Thanks for the tip, Asgaroth!

I found they call the ‘page’ action in the menu widget in the following format,


array('label'=>'About', 'url'=>array('site/page', 'view'=>'about')),

I tried to duplicate in the link, and it works


 	echo CHtml::link('See About Page', array('site/page', 'view'=>'about'));

I think view is the parameter to pass to ‘page’ action, and view is a member property of CViewAction. It’s the part that confused me before. The class reference talks about GET, but I have no idea how to specify a GET parameter.