public function __construct() { $this->parser = new Parser(); $this->compiler = new LatteCompiler(); $this->compiler->defaultContentType = LatteCompiler::CONTENT_XHTML; CoreMacros::install($this->compiler); $this->compiler->addMacro('cache', new CacheMacro($this->compiler)); UIMacros::install($this->compiler); FormMacros::install($this->compiler); }
public static function begin($form, $control, $modifiers = array()) { if ($form instanceof Form) { self::$form = $form; } else { self::$form = $control[$form]; } if (isset($modifiers["class"])) { self::$form->getElementPrototype()->class[] = $modifiers["class"]; } self::$form->render("begin"); return self::$form; }
$application->catchExceptions = false; } dibi::connect(Environment::getConfig("database")); // Step 4: Setup application router $routes = array(); /* MENU ITEMS */ $routes[] = new Route('<lang [a-z]{2}>/<id>/', array('module' => 'Front', 'presenter' => 'Page', 'action' => 'default', 'id' => array(Route::FILTER_IN => callback('MenuSeoModel::findIdByUri'), Route::FILTER_OUT => callback('MenuSeoModel::findUriById')), 'lang' => NULL)); // setup CLI mode if (Environment::isConsole()) { Debug::$productionMode = false; // to allow 'dump' render output $application->allowedMethods = false; $routes[] = new CliRouter(array('action' => 'Console:Default:default')); } $application->addRoutes($routes); FormMacros::register(); /***** ***** ** * Debug Bar * ****** ***** **/ $todoPanel = new TodoPanel(); $todoPanel->todoMask = array('TODO', 'FIXME', 'FIX ME', 'FIX', 'TO DO', 'PENDING', 'XXX'); Debug::addPanel($todoPanel); //PresenterTreePanel::register(); CallbackPanel::register(); FtpPermissionPanel::register(); //$callbacks = array(); ////můj nový callback //$callbacks[] = array( // 'name' => "Rebuild RobotLoader Cache", // 'callback' => callback(Environment::getService('Nette\Loaders\RobotLoader'), 'rebuild'), // 'args' => array() //pole argumentů pro callback