Example #1
0
 /**
  * @param ServerRequestInterface $request
  * @return ResponseInterface
  */
 public function show(ServerRequestInterface $request)
 {
     $page = Input::fromQuery('page', 1);
     $users = $this->repository->limit(($page - 1) * 10, 10)->orderBy(['id' => false])->all();
     $username = $request->getAttribute('username');
     $user = $this->repository->where(compact('username'))->one();
     return Response::plain($this->view->render('admin/users/show', compact('users', 'user')));
 }
Example #2
0
 public function settings()
 {
     return Response::plain($this->view->render('admin/settings/index'));
 }
Example #3
0
 /**
  * @param ServerRequestInterface $request
  * @return ResponseInterface
  */
 public function show(ServerRequestInterface $request)
 {
     $id = $request->getAttribute('id');
     $category = $this->repository->where(compact('id'))->one();
     return Response::plain($this->view->render('admin/categories/show', compact('category')));
 }
Example #4
0
 /**
  * @param ServerRequestInterface $request
  * @return ResponseInterface
  */
 public function show(ServerRequestInterface $request)
 {
     $page = Input::fromQuery('page', 1);
     $category = Input::fromQuery('category');
     $postsBuilder = $this->repository->limit(($page - 1) * 10, 10)->orderBy(['id' => false]);
     if (isset($category)) {
         $postsBuilder = $postsBuilder->where(['category_id' => $category]);
     }
     $id = $request->getAttribute('id');
     $post = $this->repository->where(compact('id'))->one();
     return Response::plain($this->view->render('admin/posts/show', ['posts' => $postsBuilder->all(), 'post' => $post, 'query' => isset($category) ? '?category=' . $category : '']));
 }
Example #5
0
 public function store_popup(ServerRequestInterface $request)
 {
     $id = $request->getAttribute('id');
     $post = $this->repository->where(['id' => $id])->one();
     return Response::plain($this->view->render('store_popup', compact('post')));
 }