1. Go to this page and download the library: Download celema/boiler library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$engine = Engine::create([
'theme' => '/path/to/theme',
'app' => '/path/to/templates',
]);
// Renders the first match (theme overrides app)
$engine->render('page');
// Force a specific namespace
$engine->render('app:page');
use function App\Template\icon;
$engine = Engine::create('/path/to/templates')
->method('icon', icon(...), safe: true);
use Celema\Boiler\Contract\Filter;
$engine = Engine::create('/path/to/templates')
->filter('upper', new class implements Filter {
public function apply(string $value, mixed ...$args): string
{
return strtoupper($value);
}
public function safe(): bool
{
return false;
}
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.