[Get Started] [Documentation] [Configuration]
Here you specify the folder for compilation of a template.
new \Bavix\Flow\Flow($native, [
'compile' => '/path/to/compile'
]);
To this configuration it was necessary to write the following code:
$flow = new \Bavix\Flow\Flow();
$native = $flow->native;
$native->addFolder('account', __DIR__ . '/view/account');
$native->addFolder('posts', __DIR__ . '/view/posts');
$native->addFolder('about', __DIR__ . '/view/about');
$native->addFolder('dev', __DIR__ . '/view/dev');
$native->addFolder('jobs', __DIR__ . '/view/jobs');
After addition of this configuration, it became simpler to add the folder.
new \Bavix\Flow\Flow($native, [
'folders' => [
'account' => __DIR__ . '/view/account',
'posts' => __DIR__ . '/view/account',
'about' => __DIR__ . '/view/posts',
'dev' => __DIR__ . '/view/dev',
'jobs' => __DIR__ . '/view/jobs',
]
]);
We support PSR6. Caching allows to accelerate compilation of templates. Use intelligently.
$pool = new \Stash\Pool();
$pool->setDriver(new \Stash\Driver\FileSystem([
'path' => __DIR__ . '/cache'
]));
new \Bavix\Flow\Flow($native, [
'cache' => $pool
]);
new \Bavix\Flow\Flow($native, [
'debug' => true
]);
$native = new \Bavix\Flow\Native();
$flow = new \Bavix\Flow\Flow($native, [
'compile' => __DIR__ . '/compile',
'cache' => $pool,
'debug' => true,
'minify' => true,
'extends' => [
\Bavix\Flow\Minify\Extensions\RemoveComments::class,
\Bavix\Flow\Minify\Extensions\CollapseWhitespace::class
],
'lexemes' => [
__DIR__ . '/lexemes',
],
'directives' => [
'll' => Demo\Directives\LlDirective::class
]
]);