Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M3 fix templating helper #8285

Merged
merged 5 commits into from Jan 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 4 additions & 13 deletions app/bundles/CoreBundle/Helper/TemplatingHelper.php
Expand Up @@ -12,13 +12,10 @@
namespace Mautic\CoreBundle\Helper;

use Mautic\CoreBundle\Templating\TemplateNameParser;
use Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Kernel;

/**
* Class TemplatingHelper.
*/
class TemplatingHelper
{
/**
Expand All @@ -27,8 +24,6 @@ class TemplatingHelper
protected $container;

/**
* TemplatingHelper constructor.
*
* @param Kernel $kernel
*/
public function __construct(Kernel $kernel)
Expand All @@ -39,16 +34,12 @@ public function __construct(Kernel $kernel)
/**
* Retrieve the templating service.
*
* @return \Symfony\Bundle\FrameworkBundle\Templating\DelegatingEngine
* @return DelegatingEngine
*
* @throws \Exception
*/
public function getTemplating()
{
if (defined('IN_MAUTIC_CONSOLE')) {
//enter the request scope in order to be use the templating.helper.assets service
$this->container->enterScope('request');
$this->container->set('request', new Request(), 'request');
}

return $this->container->get('templating');
}

Expand Down