Пример #1
0
 /**
  * Assigns the template [View] as the request response.
  */
 public function after()
 {
     if ($this->_autoRender === TRUE) {
         $this->response->body($this->_default->render());
     }
     parent::after();
 }
Пример #2
0
 /**
  * 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();
 }
Пример #4
0
 public function after()
 {
     if ($this->template !== NULL) {
         $this->request->body($this->template->render());
     }
     return parent::after();
 }
Пример #5
0
 public function after()
 {
     parent::after();
     if ($this->auto_render !== TRUE) {
         $this->request->response = (string) $this->content;
     }
 }
Пример #6
0
 /**
  * Assigns the template [View] as the request response.
  */
 public function after()
 {
     if ($this->auto_render === true) {
         $this->response->body($this->template->render());
     }
     parent::after();
 }
Пример #7
0
 /**
  * Assigns the template [View] as the request response.
  */
 public function after()
 {
     if ($this->auto_render === TRUE) {
         $this->request->response = $this->template;
     }
     return parent::after();
 }
Пример #8
0
 public function after()
 {
     if ($this->auto_render === TRUE) {
         $this->response->body($this->template->render());
     }
     return parent::after();
 }
Пример #9
0
 /**
  * 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();
     }
 }
Пример #10
0
 /**
  * Assigns the content [View] as the request response.
  */
 public function after()
 {
     if ($this->_view instanceof View) {
         $this->response->body($this->_view->render());
     }
     parent::after();
 }
Пример #11
0
 public function after()
 {
     parent::after();
     if ($this->auto_render === TRUE) {
         $this->response->body($this->view->render());
     }
 }
Пример #12
0
 public function after()
 {
     if ($this->auto_render) {
         Jx_Event::post($this, 'beforeRender', $this->template);
         $this->request->response = $this->template;
     }
     return parent::after();
 }
Пример #13
0
 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);
     }
 }
Пример #14
0
 public function after()
 {
     parent::after();
     $handle = $this->server->handle();
     if (Request::is_amf()) {
         $this->response->body($handle);
     }
 }
Пример #15
0
 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();
 }
Пример #16
0
 /**
  * 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();
 }
Пример #17
0
 /**
  * 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);
 }
Пример #18
0
 public function after()
 {
     if ($this->auto_render === TRUE) {
         uasort($this->template->styles, [$this, '_sort_weight']);
         $this->response->body($this->template->render());
     }
     parent::after();
 }
Пример #19
0
 /**
  * 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();
 }
Пример #20
0
 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);
 }
Пример #21
0
 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();
 }
Пример #22
0
 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);
 }
Пример #23
0
 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();
 }
Пример #24
0
	public function after()
	{
		if ($this->auto_render === true)
		{
			$this->output = $this->template;
		}

		return parent::after();
	}
Пример #25
0
 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();
 }
Пример #26
0
 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();
 }
Пример #27
0
 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();
 }
Пример #28
0
 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);
     }
 }
Пример #29
0
 /**
  * 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!');
         }
     }
 }
Пример #30
0
 /**
  *
  *
  *
  */
 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();
 }