/** * Example method. * * Segments after /home/index/ will be passed as parameters in handler method. * For example http://example.com/home/index/post/34 will call index method from home controller with * $param1 == 'post' and $param2 == '34'.<br />If you would like to see a better looking urls like http://example.com/post/34 * and home/index as handler, take a look in config/routing.php file. * * @access public * @static * @param string $param1 (default: null) * @param string $param2 (default: null) * @return void */ public static function index($param1 = null, $param2 = null) { // Do something heavy and add timer mark Load::markTime('Before views'); // Load view // Pass [key => value] as second parameter, to get variables available in your view self::render('index.html'); // Or call Load::view('Defaults/Views/index.html'); }
return Router::siteUrl($url, $prefix, $current_prefix); }); Load::$config['view_engine']->addFunction($function); // Start timer function $function = new Twig_SimpleFunction('startTimer', function () { Load::startTimer(); }); Load::$config['view_engine']->addFunction($function); // Stop timer function $function = new Twig_SimpleFunction('stopTimer', function ($name) { Load::stopTimer($name); }); Load::$config['view_engine']->addFunction($function); // Mark time function $function = new Twig_SimpleFunction('markTime', function ($name) { Load::markTime($name); }); Load::$config['view_engine']->addFunction($function); // Debug output function $function = new Twig_SimpleFunction('debugOutput', function () { return Load::debugOutput(); }); Load::$config['view_engine']->addFunction($function); } // Autoload helpers if (!empty(Load::$config['autoload_helpers'])) { foreach (Load::$config['autoload_helpers'] as $item) { $tmp = explode('/', $item); $count = count($tmp); if ($count == 3) { Load::helper($tmp[2], $tmp[1], $tmp[0]);