/** * Assigns the template [View] as the request response. */ public function after() { if ($this->_autoRender === TRUE) { $this->response->body($this->_default->render()); } parent::after(); }
/** * The after() method is called after controller action * * @uses Request::is_ajax * @uses Response::headers */ public function after() { if ($this->request->is_ajax()) { $this->response->headers('content-type', 'application/json; charset=' . Kohana::$charset); } parent::after(); }
/** * If auto_render is enabled and no response has yet been sent, selects * a content view based on the controller and action name, and then * returns the template as the request response. * * @return void */ public function after() { if ($this->auto_render === TRUE and !$this->request->response) { $this->render(); } parent::after(); }
public function after() { if ($this->template !== NULL) { $this->request->body($this->template->render()); } return parent::after(); }
public function after() { parent::after(); if ($this->auto_render !== TRUE) { $this->request->response = (string) $this->content; } }
/** * Assigns the template [View] as the request response. */ public function after() { if ($this->auto_render === true) { $this->response->body($this->template->render()); } parent::after(); }
/** * Assigns the template [View] as the request response. */ public function after() { if ($this->auto_render === TRUE) { $this->request->response = $this->template; } return parent::after(); }
public function after() { if ($this->auto_render === TRUE) { $this->response->body($this->template->render()); } return parent::after(); }
/** * Handle Request Data persistence or output based on the request type. */ public function after() { if ($this->_handle_ajax == true) { if ($this->request->is_ajax()) { $return = array(); if (RD::has_messages() == false) { $return['status'] = 'success'; $return['response'] = ['']; } else { if (RD::get_current(RD::ERROR) != null) { $return['status'] = 'error'; $return['errors'] = RD::get_current(RD::ERROR); } else { if (RD::get_current(array(RD::SUCCESS, RD::INFO)) != null) { $return['status'] = 'success'; $return['response'] = RD::get_current(array(RD::SUCCESS, RD::INFO, RD::WARNING)); } else { $return['status'] = 'success'; $return['response'] = RD::get_current(); } } } $this->response->headers('Content-Type', 'application/json'); $this->response->body(json_encode($return)); } else { //otherwise flash the messages so they can be used on the next page load if (RD::has_messages()) { RD::persist(); } parent::after(); } } else { parent::after(); } }
/** * Assigns the content [View] as the request response. */ public function after() { if ($this->_view instanceof View) { $this->response->body($this->_view->render()); } parent::after(); }
public function after() { parent::after(); if ($this->auto_render === TRUE) { $this->response->body($this->view->render()); } }
public function after() { if ($this->auto_render) { Jx_Event::post($this, 'beforeRender', $this->template); $this->request->response = $this->template; } return parent::after(); }
public function after() { parent::after(); if ($this->cache === TRUE && $this->request->status === 200 && $this->session->user->manage_dash_mods === null) { $cache = new Cache($this->cache_config); $cache->set($this->request->uri . ' :: ' . $this->session->group, $this->request->response, $this->cache_tag, $this->cache_lifetime); } }
public function after() { parent::after(); $handle = $this->server->handle(); if (Request::is_amf()) { $this->response->body($handle); } }
public function after() { $this->view->controller = $this->getRequest()->getController(); $this->view->action = $this->getRequest()->getAction(); $this->view->template = str_replace(DOC_ROOT, '', $this->view->getView()); // Load parent::after to render this controller. parent::after(); }
/** * Renders the template if necessary * * @return void */ public function after() { if ($this->auto_render) { // Auto-render the template $this->request->response = $this->template; } return parent::after(); }
/** * After controller method has run output the template * * @param Response $response */ public function after($response) { // If nothing was returned default to the template if (empty($response)) { $response = $this->template; } return parent::after($response); }
public function after() { if ($this->auto_render === TRUE) { uasort($this->template->styles, [$this, '_sort_weight']); $this->response->body($this->template->render()); } parent::after(); }
/** * Renders the template if necessary * * @return void */ public function after() { if ($this->auto_render) { // Auto-render the template $this->response->body($this->template); } parent::after(); }
public function after($response) { // If the response is a Response object, we will use their instead of // ours. if (!$response instanceof \Response) { $response = $this->response; } return parent::after($response); }
public function after() { if (isset($this->menu)) { $this->tpl->menu = View::factory($this->menu); } $this->tpl->set_filename($this->layout); $this->response->body($this->tpl->render()); return parent::after(); }
public function after($response) { // If the response is a Response object, we don't want to create a new one if ($this->auto_render === true and !$response instanceof \Response) { $response = $this->response; $response->body = $this->template; } return parent::after($response); }
public function after() { if ($this->template !== NULL) { $this->template->bind('rating', $this->rating); $this->template->bind('comments', $this->comments); $this->response->body($this->template->render()); } return parent::after(); }
public function after() { if ($this->auto_render === true) { $this->output = $this->template; } return parent::after(); }
public function after() { if ($this->request === Request::instance()) { if ($this->request->param('format') == 'html') { $this->request->response = View::factory('html/template')->set(array('title' => 'Moni - The personal finance manager', 'styles' => array('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/smoothness/jquery-ui.css' => 'screen', 'media/css/default.css' => 'screen'), 'scripts' => array('https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js', 'media/js/jquery-ui-timepicker-addon.js', 'media/js/jquery.maskMoney.js', 'media/js/default.js'), 'content' => $this->request->response)); } elseif ($this->request->param('format') == 'json') { $this->request->headers['Content-Type'] = 'application/json'; } } parent::after(); }
public function after() { if ($this->request->response instanceof View_Layout) { if (Request::$is_ajax) { // Display only the page content for AJAX requests $this->request->response->layout = FALSE; } $this->request->response = $this->request->response->render(); } return parent::after(); }
public function after() { if (is_string($this->error)) { $this->result['errormessage'] = $this->error; $this->result['success'] = FALSE; } $this->response->body(json_encode($this->result)); $this->response->headers('Content-Type', 'application/json'); $this->response->send_headers(); parent::after(); }
public function after() { parent::after(); switch ($this->response->headers('Content-type')) { case 'application/json': $this->response->body(json_encode(array('success' => $this->success, 'message' => $this->message, 'data' => $this->data))); break; default: $this->response->body($this->data); } }
/** * Assign the [Kostache_Layout] render as the request response **/ public function after() { parent::after(); if ($this->auto_render) { if (isset($this->view)) { $this->response->body($this->layout->render($this->view)); } else { $this->response->body('View Model <code>View_' . ucfirst(Request::initial()->controller()) . '_' . ucfirst(Request::initial()->action()) . '</code> not found!'); } } }
/** * * * */ public function after() { $this->template->set('version', $this->config->version); $format = FALSE; if (array_key_exists('json_print_pretty', $_GET)) { $format = TRUE; } if (method_exists('format', $this->template)) { $this->template->format($format); } parent::after(); }