Constructor.
public __construct ( array $config = [] ) : void | ||
$config | array | Available configuration options are: - `view`: The `View` object associated with this renderer. - `strings`: String templates used by helpers. - `handlers`: An array of output handlers for string template inputs. - `request`: The `Request` object associated with this renderer and passed to the defined handlers. - `response`: The `Response` object associated with this renderer. - `context`: An array of the current rendering context data, including `content`, `title`, `scripts`, `head` and `styles`. |
return | void |
/** * Constructor for this adapter - sets relevant default configurations for Twig to be used * when instantiating a new Twig_Environment and Twig_Loader_Filesystem. * * @param array $config Optional configuration directives. * Please see http://www.twig-project.org/book/03-Twig-for-Developers for all * available configuration keys and their description. * There are 4 settings that is set * - `cache`: Path to /resources/tmp/cache/templates/ where compiled templates will be stored * - `auto_reload`: If Environment is not production, templates will be reloaded once edited * - `base_template_class`: Overriden to the Template adapter, be carefull with changing this * - `autoescape`: Set to false because the way we inject content is with full html that should not be escaped * @return void */ public function __construct(array $config = array()) { /** * TODO Change hardcoded LITHIUM_APP_PATH to be dynamic */ $defaults = array('cache' => LITHIUM_APP_PATH . '/resources/tmp/cache/templates', 'auto_reload' => !Environment::is('production'), 'base_template_class' => 'li3_twig\\template\\view\\adapter\\Template', 'autoescape' => false); parent::__construct($config + $defaults); }
public function __construct($config = array()) { $this->_smarty = new \Smarty(); $this->_smarty->compile_dir = $config['compile_dir']; $this->_smarty->cache_dir = $config['cache_dir']; $this->_smarty->setTemplateDir($config['template_dir']); $this->_smarty->addPluginsDir($config['plugin_dir']); $defaults = array('classes' => array()); parent::__construct($config + $defaults); }
public function __construct(array $config = array()) { $defaults = array('classes' => array(), 'compile' => true, 'compiler' => array(), 'extract' => true, 'paths' => array()); parent::__construct($config + $defaults); }
public function __construct($config = array()) { $defaults = array('classes' => array(), 'compile' => true); parent::__construct((array) $config + $defaults); }
/** * Constructor for this adapter - sets relevant default configurations for Twig to be used * when instantiating a new Twig_Environment and Twig_Loader_Filesystem. * * @param array $config Optional configuration directives. * Please see http://www.twig-project.org/book/03-Twig-for-Developers for all * available configuration keys and their description. * There are 4 settings that is set * - `cache`: Path to /resources/tmp/cache/templates/ where compiled templates will be stored * - `auto_reload`: If Environment is not production, templates will be reloaded once edited * - `base_template_class`: Overriden to the Template adapter, be carefull with changing this * - `autoescape`: Set to false because the way we inject content is with full html that should not be escaped * @return void * @todo Change hardcoded LITHIUM_APP_PATH to be dynamic */ public function __construct(array $config = array()) { $defaults = array('cache' => Twig::cachePath(), 'auto_reload' => !Environment::is('production'), 'autoescape' => false); parent::__construct($config + $defaults); }
public function __construct($config = array()) { $defaults = array('classes' => array()); parent::__construct($config + $defaults); }