Yii implements the method of displaying static pages, and Yii implements static
The example in this paper describes the method that Yii implements to display static pages. Share to everyone for your reference, as follows:
Use a cviewaction built into Yii to serve all of these pages.
First, build a controller class such as Doccontroller, covering the actions method
Public function Actions () { return Array ( ' page ' =>array ( ' class ' = ' cviewaction ', ), );}
According to the official guidelines, the above code declares an external action class cviewaction.
Then, generate the directory protected/views/Doc/pages.
Finally, a file is stored in this directory called about.php, with the content: "About this Site", where these pages will use the app's default layout file. Therefore, this document only describes the relevant content on this page.
http://www.yourhost.com/index.php?r=doc/page&view=about
If you have a lot of static pages, you can put them in subdirectories, assuming there is a static page in protected/views/doc/pages/help/contact.php:
http://www.yourhost.com/index.php?r=doc/page&view=help.contact
Of course, we can also customize the behavior of Cviewaction, view the API documentation to learn more about Cviewaction
For more information on YII related content readers can view this site topic: "YII framework Introduction and common skills Summary", "PHP Excellent Development Framework Summary", "Smarty Template Primer Basic Tutorial", "PHP date and Time usage summary", "PHP object-oriented Programming introduction Tutorial", " PHP String Usage Summary, "Getting Started with Php+mysql database operations" and "PHP Common Database Operations Skills Summary"
It is hoped that this article is helpful to the PHP program design based on YII framework.
http://www.bkjia.com/PHPjc/1123836.html www.bkjia.com true http://www.bkjia.com/PHPjc/1123836.html techarticle yii Implementation of static page display method, Yii implementation of static This article describes the Yii implementation of the method of displaying static pages. Share to everyone for your reference, as follows: Using Yii built-in ...