Revision #16 has been created by yasen on Dec 2, 2012, 11:32:57 AM with the memo:
replaced missing variable with $_GET['view']
« previous (#15)
Changes
Title
unchanged
How to display static pages in Yii with database content?
Category
unchanged
Tutorials
Yii version
unchanged
Tags
unchanged
static pages, database
Content
changed
[...]
```php
public function actionPage() {
if(empty($_GET['view']))
$this->actionIndex();
$model = Spage::model()->findByUrl($_GET['view']);
// if page is not found, then run a controller with that name
if ($model === NULL)
Yii::app()->runController($
controller_GET['view']);
else
$this->render('pages/spage', array('model'=>$model));
}
```[...]