From 205f1759c9d99d0ab4d6cb0390a2d113f6232e24 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 31 May 2019 17:13:06 +0300 Subject: [PATCH] Flextype Box Plugin: Admin #125 #117 - Entries Controller/Views implementation --- .../admin/app/Controllers/EntriesController.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/site/plugins/admin/app/Controllers/EntriesController.php b/site/plugins/admin/app/Controllers/EntriesController.php index 97df7732..2f9c0a9f 100644 --- a/site/plugins/admin/app/Controllers/EntriesController.php +++ b/site/plugins/admin/app/Controllers/EntriesController.php @@ -24,11 +24,24 @@ class EntriesController extends Controller public function index($request, $response, $args) { + $id = $request->getQueryParams()['id']; + + if ($id == null) { + $id = [0 => '']; + } else { + $id = explode("/", $request->getQueryParams()['id']); + } + + var_dump($id); + return $this->view->render($response, 'plugins/admin/views/templates/content/entries/index.html', [ - 'entries_list' => $this->entries->fetchAll($this->getEntriesQuery($request->getQueryParams()['entry']), 'date', 'DESC'), - 'entry_current' => $this->getEntriesQuery($request->getQueryParams()['entry']), + 'entries_list' => $this->entries->fetchAll($this->getEntriesQuery($request->getQueryParams()['id']), 'date', 'DESC'), + 'entry_current' => $this->getEntriesQuery($request->getQueryParams()['id']), 'menu_item' => 'entries', + 'parts' => $id, + 'i' => count($id), + 'last' => Arr::last($id), 'links' => [ 'entries' => [ 'link' => $this->router->urlFor('admin.entries.index'),