Warp12
A simple site management system written on Symfony., (*1)
Install:
composer require snakemkua/warp12bundle
composer require stof/doctrine-extensions-bundle
Register bundle
Add line to file app/AppKernel.php into $bundles, (*2)
$bundles = [
...
new snakemkua\Warp12Bundle\Warp12Bundle(),
]
Create new module bundle
bin/console generate:bundle
Activate it if it wasn't activated automatically - add record to composer.json:, (*3)
"autoload": {
"psr-4": {
"": "src/"
}
}
and recompile autoload:, (*4)
composer dump-autoload
Implement your controller:
class DefaultController extends Controller implements WarpModuleInterface
{
public function warpDropdownMenu(Request $request){
}
public function warpUIRenderLayout(Request $request){
}
public function warpTopLine(Request $request){
}
}
Define template for default page
parameters:
warp12templates:
page_default: YourBundle:Default:page.html.twig
#page_404:YourBundle:Default:404.html.twig
You can create a hook page if you need to send more data to your template.
Hook page content:, (*5)
{{ render(controller(('YourBundle\\Controller\\DefaultController::renderPage'), {'request': app.request, 'page': page})) }}