本文整理汇总了PHP中Phalcon\Mvc\View\Engine\Volt::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Volt::__construct方法的具体用法?PHP Volt::__construct怎么用?PHP Volt::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phalcon\Mvc\View\Engine\Volt
的用法示例。
在下文中一共展示了Volt::__construct方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(\Phalcon\Mvc\ViewBaseInterface $view, \Phalcon\DiInterface $di)
{
parent::__construct($view, $di);
require CORE_PATH . 'config/volt.functions.php';
foreach ($voltFunctions as $macro => $function) {
$this->getCompiler()->addFunction($macro, $function);
}
$this->getCompiler()->setOptions(array('stat' => true, 'compileAlways' => true));
}
示例2: __construct
public function __construct(ViewBaseInterface $view, DiInterface $di = null)
{
parent::__construct($view, $di);
$debug = false;
if (config()->app->debug) {
$debug = true;
}
$this->setOptions(['compiledSeparator' => '_', 'compiledPath' => storage_path('views') . '/', 'compileAlways' => $debug]);
foreach ($this->functions as $func) {
$this->getCompiler()->addFunction($func, $func);
}
}
示例3: __construct
public function __construct(ViewBaseInterface $view, DiInterface $dependencyInjector, $development = true, $prefix = '')
{
parent::__construct($view, $dependencyInjector);
$this->setOptions(['compiledPath' => function ($templatePath) use($view, $development, $prefix) {
$dir = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'volt-cache';
if (!is_dir($dir)) {
mkdir($dir);
}
if ($prefix !== '') {
$prefix .= '%';
}
return $dir . DIRECTORY_SEPARATOR . $prefix . str_replace(DIRECTORY_SEPARATOR, '%', str_replace($view->getViewsDir(), '', $templatePath)) . '.php';
}, 'compileAlways' => $development]);
}
示例4: __construct
public function __construct($a, $b)
{
// $this->log = new \Phalcon\Logger\Adapter\File(getcwd().'/view.log');
parent::__construct($a, $b);
}
示例5: __construct
public function __construct($view, $dependencyInjector = null)
{
parent::__construct($view, $dependencyInjector);
}