1
0

Improved Blogpost view

This commit is contained in:
2014-07-12 16:42:24 +02:00
parent abcc540713
commit 14f3d5df3b
8 changed files with 245 additions and 158 deletions

View File

@@ -125,10 +125,16 @@ class BlogPostController extends MSController
*/
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('BlogPost');
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
$criteria = new CDbCriteria;
$criteria->order = "Date DESC";
$all = BlogPost::model()->findAll($criteria);
$this->render('index',
[
'blogposts' => $all,
]
);
}
public function actionAjaxMarkdownPreview() {