/** * custom theme render stuff * * @param string $file * @return string */ public function render($file = null) { foreach (static::$config->default as $key => $value) { $this->set($key, $value); } // assign the topic to the title if ($this->has('topic') && $this->has('title')) { $this->title = sprintf($this->get('title'), $this->get('topic')); } // add default assets \CCAsset::add('js/jquery/jquery.js'); \CCAsset::add('js/bootstrap.min.js', 'theme'); \CCAsset::add('css/bootstrap.min.css', 'theme'); \CCAsset::add('css/style.css', 'theme'); return parent::render($file); }
/** * custom theme render stuff * * @param string $file * @return string */ public function render($file = null) { foreach (static::$config->default as $key => $value) { if (!$this->has($key)) { $this->set($key, $value); } } // assign the topic to the title if ($this->has('topic') && $this->has('title')) { $this->title = sprintf($this->get('title'), $this->get('topic')); } // add assets from config foreach (static::$config->assets as $asset => $container) { $container = explode("@", $container); if (isset($container[1])) { \CCAsset::pack($asset, $container[0], $container[1]); } else { \CCAsset::add($asset, $container[0]); } } return parent::render($file); }