diff --git a/frontend/controllers/BlogController.php b/frontend/controllers/BlogController.php new file mode 100644 index 0000000..284763d --- /dev/null +++ b/frontend/controllers/BlogController.php @@ -0,0 +1,39 @@ + Article::find() + ->orderBy( + [ + 'created_at' => SORT_DESC, + ] + ), + 'pagination' => [ + 'pageSize' => 3, + ], + ] + ); + + return $this->render( + 'index', + [ + 'dataProvider' => $dataProvider, + ] + ); + } + } \ No newline at end of file diff --git a/frontend/views/blog/_article.php b/frontend/views/blog/_article.php new file mode 100644 index 0000000..986f26d --- /dev/null +++ b/frontend/views/blog/_article.php @@ -0,0 +1,36 @@ + + +
+
+
+
+
+ +
+
+
+
+

Название статьи

+ +

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. + Aenean ultricies mi vitae est. Mauris placerat eleifend leo.

+

Продолжить чтение +

+
+
+
diff --git a/frontend/views/blog/index.php b/frontend/views/blog/index.php new file mode 100644 index 0000000..5ccc552 --- /dev/null +++ b/frontend/views/blog/index.php @@ -0,0 +1,123 @@ + + +
+
+
+ + +
+ + + + + +
+ + + + $dataProvider, + 'itemView' => '_article', + 'options' => [ + 'class' => 'col-md-9', + 'id' => 'blog-listing-medium', + ], + ] + ); ?> + + + + + + +
+ + + + + + + + + + +
+ + + + +
+ +
+ +
+ \ No newline at end of file -- libgit2 0.21.4