A really simple working example of standalone blade templating using the Windwalker Renderer
composer update
Enter base url for proper URL generation:
const BASE_URL = 'http://localhost';
Implement any helper your template might use:
function asset($path)
{
return BASE_URL . '/assets'. $path;
}
- Put your blade files in the
views/
folder.
<h1>Welcome!</h1>
<p>
<a href="{{ url('example') }}">Example</a>
</p>
- Create a 'controller' for each page in the
pages/
folder
class Page
{
function show($renderer)
{
//Render the views/welcome.blade.php file
return $renderer->render('welcome', []);
}
}
- Access your pages by controller file name
http://localhost => pages/index.php
http://localhost/example => pages/example.php