/** * Print debuginformation from the framework. */ function get_debug() { $ly = CLydia::Instance(); $html = "<h2>Debuginformation</h2><hr><p>The content of the config array:</p><pre>" . htmlentities(print_r($ly->config, true)) . "</pre>"; $html .= "<hr><p>The content of the data array:</p><pre>" . htmlentities(print_r($ly->data, true)) . "</pre>"; $html .= "<hr><p>The content of the request array:</p><pre>" . htmlentities(print_r($ly->request, true)) . "</pre>"; return $html; }
/** * Constructor * * @param string name of the element. * @param array attributes to set to the element. Default is an empty array. */ public function __construct($name, $attributes = array()) { $this->attributes = $attributes; $this['name'] = $name; //$this['key'] = $name; //$this['name'] = isset($this['name']) ? $this['name'] : $name; if (is_callable('CLydia::Instance()')) { $this->characterEncoding = CLydia::Instance()->config['character_encoding']; } else { $this->characterEncoding = 'UTF-8'; } }
/** * Constructor creating a form element. * * @param string $name of the element. * @param array $attributes to set to the element. Default is an empty array. */ public function __construct($name, $attributes = []) { $this->attributes = $attributes; $this['name'] = $name; //$this['key'] = $name; //$this['name'] = isset($this['name']) ? $this['name'] : $name; // Use character encoding from lydia if available, else use UTF-8 OBSOLETE, remove this. if (is_callable('CLydia::Instance()')) { $this->characterEncoding = CLydia::Instance()->config['character_encoding']; } else { $this->characterEncoding = 'UTF-8'; } }
/** * Create a method that shows the menu, same for all methods */ private function Menu() { $ly = CLydia::Instance(); $menu = array('developer', 'developer/index', 'developer/links'); $html = null; foreach ($menu as $val) { $html .= "<li><a href='" . $ly->request->CreateUrl($val) . "'>{$val}</a>"; } $ly->data['title'] = "The Developer Controller"; $ly->data['main'] = <<<EOD <h1>The Developer Controller</h1> <p>This is what you can do for now:</p> <ul> {$html} </ul> EOD; }
<?php // PHASE: BOOTSTRAP // define('LYDIA_INSTALL_PATH', dirname(__FILE__)); define('LYDIA_SITE_PATH', LYDIA_INSTALL_PATH . '/site'); require LYDIA_INSTALL_PATH . '/src/CLydia/bootstrap.php'; $ly = CLydia::Instance(); // // PHASE: FRONTCONTROLLER ROUTE // $ly->FrontControllerRoute(); // // PHASE: THEME ENGINE RENDER // $ly->ThemeEngineRender(); //"bootstrap" är initieringsfasen där de oundvikliga grunderna //etableras och defineras. Dessa behövs i varje förfrågan. //"frontController->route" tar hand om förfrågan och tolkar //ut vilken kontroller och metod som skall anropas. //Därefter sker all bearbetning i kontrollern. //"themeEngine->render" skapar själva slutresultatet, //webbsidan. Allt innehåll finns tillgängligt och med //hjälp av template-filer överförs innehållet till HTML-filer.