remove AdminController constructor
This commit is contained in:
parent
a713a4d263
commit
3979feb80c
|
@ -3,19 +3,11 @@
|
||||||
namespace App\Core\Controller\Admin;
|
namespace App\Core\Controller\Admin;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
|
||||||
abstract class AdminController extends AbstractController
|
abstract class AdminController extends AbstractController
|
||||||
{
|
{
|
||||||
protected array $coreParameters;
|
|
||||||
|
|
||||||
public function __construct(ParameterBagInterface $parameters)
|
|
||||||
{
|
|
||||||
$this->coreParameters = $parameters->get('core');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/_ping", name="_ping")
|
* @Route("/_ping", name="_ping")
|
||||||
*/
|
*/
|
||||||
|
@ -29,10 +21,17 @@ abstract class AdminController extends AbstractController
|
||||||
*/
|
*/
|
||||||
protected function render(string $view, array $parameters = [], Response $response = null): Response
|
protected function render(string $view, array $parameters = [], Response $response = null): Response
|
||||||
{
|
{
|
||||||
$parameters['section'] = $this->getSection();
|
$params = $this->getParameter('core')['site'];
|
||||||
$parameters['site_name'] = $this->coreParameters['site']['name'];
|
|
||||||
$parameters['site_logo'] = $this->coreParameters['site']['logo'];
|
$parameters = array_merge(
|
||||||
$parameters['murph_version'] = defined('MURPH_VERSION') ? MURPH_VERSION : null;
|
$parameters,
|
||||||
|
[
|
||||||
|
'section' => $this->getSection(),
|
||||||
|
'site_name' => $params['name'],
|
||||||
|
'site_logo' => $params['logo'],
|
||||||
|
'murph_version' => MURPH_VERSION,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
return parent::render($view, $parameters, $response);
|
return parent::render($view, $parameters, $response);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue