public function beforeRender() { /** * Automated CSS load * * $cssFiles array is used to automatically load controller and action specific CSS files for layout if either one exists. * * We search for controller specific CSS file from: css/controller/controller.css * Then we search for action specific CSS file from: css/controller/action.css * After searches, we set this array to $css_for_layout for layout * */ $cssFiles = array(); if (file_exists(CSS . DS . strtolower($this->name) . DS . strtolower($this->name) . '.css')) { $cssFiles[] = strtolower($this->name) . DS . strtolower($this->name); } if (file_exists(CSS . DS . strtolower($this->name) . DS . $this->action . '.css')) { $cssFiles[] = strtolower($this->name) . DS . $this->action; } $this->set('css_for_layout',$cssFiles); //End of automated CSS load /** * Jsmeta - Inject JSON encoded PHP variables for Javascript access (hidden metabox in layout) * Uses jsmeta.php in libs */ $Jsmeta = new Jsmeta(); $this->set('Jsmeta',$Jsmeta->append("baseUrl",$this->base)); }
public function beforeRender() { $this->set('css_for_layout', $this->__getScripts('css')); $this->set('js_for_layout', $this->__getScripts('js')); /** * Jsmeta - Inject JSON encoded PHP variables for Javascript access (hidden metabox in layout) * Uses jsmeta.php in libs */ $Jsmeta = new Jsmeta(); $this->set('Jsmeta', $Jsmeta->append("baseUrl", $this->base)); }