function index() { //love easy $this->load_model("content", "content_obj"); $content_row = $this->content_obj->get(); // Load view $tpl = new View(); $tpl->assign($content_row); $tpl->draw('content/content'); }
function index() { $chart_pie = $chart_line = null; //love easy $this->load_library("Charts"); $data = array(array('OSX', 10), array('Win', 3), array('Unix', 7)); $this->Charts->set_data($data); //$chart_pie = $this->Charts->draw_pie(); $this->Charts->load_csv(WEBSITE_DIR . "assign_execution_time.csv"); $chart_line = $this->Charts->draw_line(); $tpl = new View(); $tpl->assign("chart_pie", $chart_pie); $tpl->assign("chart_line", $chart_line); $tpl->draw("charts/charts"); }
private static function draw($time) { echo View::draw(self::$plane->getRoll(), self::$plane->getPitch(), $time, self::$plane->getSpeed(), self::$plane->getAltitude(), self::$plane->getPower()); }
* @param string $name Name of loaded target with or without namespace * @return null */ spl_autoload_register(function ($name) { $name = ltrim($name, '\\'); if (strpos($name, '\\', 1)) { $name = str_replace('\\', '/', $name); $path = APPLICATION . $name . '.php'; if (!is_file($path)) { throw new SystemErrorException(array('title' => 'Autoload error', 'description' => 'File ' . $path . ' is not exists')); } } else { $path = $name . '.php'; } require $path; }, false); // Run application try { $isCLI = PHP_SAPI == 'cli'; App::init($useMemory, $startTime, $isCLI); Member::beforeInit(); View::init(); if ($isCLI) { CliEnv::init($argv); } App::run(); } catch (Exception $e) { View::assignException($e); } View::draw();
/** * Draw the output * * @param bool $return_string if true return a string else draw the page * @return string */ function draw($return_string = false) { $tpl = new View(); // assign all variable $tpl->assign($this->var); // - LOAD AREA ---- // wrap all the blocks in a load area if ($this->load_area_array) { foreach ($this->load_area_array as $load_area_name => $blocks_array) { $load_area[$load_area_name] = $this->_blocks_wrapper($blocks_array); } $tpl->assign("load_area", $load_area); } // ---------------- // - HEAD ------ $head = get_javascript() . get_style(); $tpl->assign("head", $head); // -------------- // - BENCHMARK ------ $tpl->assign("execution_time", timer()); $tpl->assign("memory_used", memory_usage()); $tpl->assign("loaded_controller", $this->loaded_controller); $tpl->assign("n_query", class_exists('db') ? db::get_executed_query() : null); // -------------- return $tpl->draw($this->page_layout, $return_string); }