Hi there,
I have a ContextController, that extend BaseController.
I use this ContextController inside of all my front controllers (i.e no in admin panel).
<?php
use Acme\Contexts\ContextInterface;
/**
* Class ContextController
*/
class ContextController extends BaseController {
/**
* @var Context
*/
public $context;
public function __construct(ContextInterface $context)
{
$this->context = $context;
View::share('context', $context->getContext());
}
}
This Acme\Contexts\ContextInterface is loaded by a service provider.
Here is a controller, extending my ContextController :
class ConceptController extends \ContextController {
public $shops;
public function __construct( ShopRepository $shops ){
$this->shops = $shops;
parent::__construct();
}
}
The problem is that when I load a page, I get this error :
Argument 1 passed to ContextController::__construct() must be an instance of Acme\Contexts\ContextInterface, none given, called in ConceptController.php
I've tried to delete the parent::__construct(); but in that case, I don't get my context data shared in my views.
How should I solve that ?
Thanks