public function __shutdown() { // Don't render the layout for json content if (Router::$extension == 'json') { $this->render['layout'] = false; } // Render the view $content = ''; if ($this->render['view']) { Body::append(View::render($this->render['view'])); } // Are we wrapping the view in a layout? if ($this->render['layout']) { $content = Body::content(); Body::clear(); Body::append(View::render("layouts/{$this->render['layout']}", array('content' => $content))); } else { Body::append($content); } // Set the X-Powered-By header and render the layout with the content header("X-Powered-By: Avalon/" . Kernel::version()); print(Body::content()); }
/** * Ticket task form bit. */ public function action_form_bit() { $this->render['layout'] = false; // Task data $id = isset(Request::$request['id']) ? Request::$request['id'] : 0; $completed = isset(Request::$request['completed']) ? Request::$request['completed'] == "true" ? true : false : false; $task = isset(Request::$request['task']) ? Request::$request['task'] : ''; return View::render('ticket_tasks/_form_bit', array('id' => $id, 'completed' => $completed, 'task' => $task)); }
/** * Adds the question field to the register form. */ public static function question_field() { // Get the questions $questions = json_decode(settings('security_questions'), true); // Get a random question $id = rand(0, count($questions) - 1); $question = $questions[$id]; $_SESSION['question_id'] = $id; echo View::render('users/_question_field', array('question' => $question)); }
/** * Display tabs */ public static function display_tabs() { echo View::render('custom_tabs/tabs'); }