diff --git a/engine/app/controller/MainController.php b/engine/app/controller/MainController.php index 3d697a1..f2e5d1a 100644 --- a/engine/app/controller/MainController.php +++ b/engine/app/controller/MainController.php @@ -2,17 +2,35 @@ require_once __DIR__ . "/../model/MusicModel.php"; require_once __DIR__ . "/../view/View.php"; +require_once __DIR__ . "/../../core/Paginator.php"; class MainController { -public function actionIndex() { - $result = MusicModel::getData(); - echo(View::render(['box' => $result], 'index_tpl.php')); -} + private $limit = Null; + private $offset = Null; + + public function actionIndex() + { + $result = MusicModel::getData(); + $builder = new MusicPageBuilder($result); + $portial = $builder->setFeed(); + echo (View::render(['portial' => $portial], 'index_tpl.php')); + } public function actionNotFound() { echo (View::render([], '404.php')); } + + public function actionPortial() + { + // $this->limit = isset($_GET['limit']) ? $_GET['limit'] : Null; + // $this->offset = isset($_GET['offset']) ? $_GET['offset'] : Null; + $result = MusicModel::getData(); + // var_dump($result); + $builder = new MusicPageBuilder($result); + $page = $builder->setFeed(); + echo $page; + } } diff --git a/engine/app/template/index_tpl.php b/engine/app/template/index_tpl.php index 95497b6..34f0e8c 100644 --- a/engine/app/template/index_tpl.php +++ b/engine/app/template/index_tpl.php @@ -2,82 +2,106 @@
- - - -Файл "" не найден.
+ diff --git a/engine/app/template/tpl_layout.php b/engine/app/template/tpl_layout.php index dc82b3d..387b7b5 100644 --- a/engine/app/template/tpl_layout.php +++ b/engine/app/template/tpl_layout.php @@ -28,23 +28,45 @@ +Файл "" не найден.
- - +