From 0d55c3291b237a2005f99a399b0fa178f6b973e0 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 10 May 2017 12:54:14 +0300 Subject: [PATCH] -Blog at frontend started --- frontend/controllers/BlogController.php | 39 +++++++++++++++++++++++++++++++++++++++ frontend/views/blog/_article.php | 36 ++++++++++++++++++++++++++++++++++++ frontend/views/blog/index.php | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 198 insertions(+), 0 deletions(-) create mode 100644 frontend/controllers/BlogController.php create mode 100644 frontend/views/blog/_article.php create mode 100644 frontend/views/blog/index.php 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