Example #1
0
 public function removeAction(Request &$request)
 {
     if ($id = $request->get('id')) {
         if ($this->remove($id)) {
             return $this->redirect(BASE_URL . Sokol::getCom()->name . '/' . $this->name . '/list');
         }
     }
     $smarty = Smarty::getInstance();
     $smarty->assign('content', 'Item not found');
     return new Response(Smarty::fetchTemplate('index.tpl'));
 }
Example #2
0
 protected function render(array $array = null, array $globals = null)
 {
     $smarty = Smarty::getInstance();
     if ($array) {
         $smarty->assign($array);
     }
     if ($globals) {
         foreach ($globals as $key => $value) {
             $smarty->assignGlobal($key, $value);
         }
     }
     $response = Sokol::getResponse();
     $response->setContent(Smarty::fetchTemplate($this->getTmplName()));
     $response->setStatusCode(200);
     return $response;
 }