mirror of
https://github.com/jbcr/core.git
synced 2026-04-29 03:33:24 +02:00
Prevent breakage when switching to PROD, with {{ dump }} in the templates
This commit is contained in:
@@ -67,7 +67,9 @@ services:
|
||||
- { name: knp_menu.menu_builder, method: createAdminMenu, alias: admin_menu } # The alias is what is used to retrieve the menu
|
||||
|
||||
Bolt\Menu\BackendMenuBuilderInterface: '@Bolt\Menu\BackendMenuBuilder'
|
||||
|
||||
Bolt\Menu\FrontendMenuBuilder: ~
|
||||
|
||||
Bolt\Menu\FrontendMenuBuilderInterface: '@Bolt\Menu\FrontendMenuBuilder'
|
||||
|
||||
# Needed for SetContent from bolt/core
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Bolt\Twig;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Dump Twig extension.
|
||||
*
|
||||
* This is a (deliberately) empty extension. When the implementor switched a
|
||||
* site from DEV to PROD, it shouldn't break if there's a lingering `{{ dump }}`
|
||||
* left in the site. This Twig Extension acts as a fallback to prevent that.
|
||||
*/
|
||||
class DumpExtension extends AbstractExtension
|
||||
{
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
new TwigFunction('dump', [$this, 'dump']),
|
||||
];
|
||||
}
|
||||
|
||||
public function dump(): void
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user