No errors at all, nothing in application.log, it is working as I want it to.
Here is the full actionIndex (I made a few more changes since I fixed it, but it still works) -
public function actionIndex()
{
$criteria=new CDbCriteria(array(
'condition'=>'status='.Post::STATUS_PUBLISHED,
'order'=>'update_time DESC',
'with'=>'commentCount',
'with'=>'mediaCount',
));
if(isset($_GET['tag']))
$criteria->addSearchCondition('tags',$_GET['tag']);
if(isset($_GET['type']))
$criteria->addSearchCondition('type',$_GET['type']);
if(isset($_GET['tag'])) {
$dataProvider=new CActiveDataProvider('Post', array(
'criteria'=>$criteria,
));
} else {
$dataProvider=new CActiveDataProvider('Post', array(
'pagination'=>array(
'pageSize'=>Yii::app()->params['postsPerPage'],
),
'criteria'=>$criteria,
));
}
if(isset($_GET['tag'])) {
$criteria2=new CDbCriteria(array(
'order'=>'upload_time DESC',
));
$criteria2->addSearchCondition('tags',$_GET['tag']);
if(isset($_GET['type'])) {
$criteria2->addSearchCondition('type',$_GET['type']);
}
$dataProvider2=new CActiveDataProvider('Media', array(
'criteria'=>$criteria2,
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
'dataProvider2'=>$dataProvider2,
));
} else {
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
}
There have been a few other strange things though, I can’t get CWebLogRoute working.
From main.php -
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning'
),
array(
'class'=>'CWebLogRoute',
'levels'=>'trace, info, error, warning'
),
),
),
Also, I don’t always get the flash message when submitting a form.
Sometimes all submitting the form appears to do is refresh the page.
Maybe there is something wrong with my setup?