本文整理匯總了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);
}