Exemplo n.º 1
0
 public function itemAction($id)
 {
     try {
         $item = $this->manager->getItem($id);
     } catch (NotFoundException $e) {
         throw new NotFoundHttpException($e->getMessage());
     }
     return $this->templating->renderResponse($this->templateItem, ['item' => $item]);
 }
Exemplo n.º 2
0
 public function itemFunction(\Twig_Environment $env, $id, array $options = [])
 {
     $data = $this->setOptions($options);
     $data['item'] = $this->manager->getItem($id);
     return $env->render($data['tpl_item'], $data);
 }