Esempio n. 1
0
 /**
  * @param $request \Model\Entity\Request
  * @return null
  */
 public function noAccess($request)
 {
     $response = new HTMLResponse('error.twig');
     $response->setTwigVariables(['title' => !empty($this->errorMessage) ? $this->errorMessage : 'No access to this file.', 'message' => 'You have no access to this file.']);
     $response->addHeaderField('HTTP/1.0', '403 Forbidden');
     return $response;
 }
 public function journalAction($request)
 {
     $response = new HTMLResponse('journal/journal.twig');
     $journalRepository = new Repository(new Journal(), $this->database);
     $id = $request->matches['id'];
     $journal = $journalRepository->findById($id);
     $response->setTwigVariables(['journal' => $journal]);
     return $response;
 }
Esempio n. 3
0
 /**
  * @param $request \Model\Entity\Request
  * @return \Fredy\View\Response
  */
 function subdomainAction($request)
 {
     $response = new HTMLResponse('subdomain.twig');
     $response->setTwigVariables(['subdomain' => $request->matches['subdomain']]);
     return $response;
 }
 function __construct($templatePath, $request)
 {
     parent::__construct($templatePath);
     $this->setTwigVariables(['Navigation' => new Navigation($request)]);
 }