symfony - sylius ResourceController defines constructor
迷茫
迷茫 2017-05-16 16:44:21
0
1
525

The most common one is that sylius has customized a constructor in the ResourceController of ResourceBundle.

public function __construct(Configuration $config)
{
$this->config = $config;
}

You cannot customize the constructor in the symfony2 Controller. Don't know how he achieved it

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
曾经蜡笔没有小新

Use the controller as a service and use the form sylius.controller.cart:indexAction in the routing table, so that the service can be initialized while sending the request. As for the parameters in the constructor, it depends on the argument attribute of your service.xml. The dependency injection method is more flexible. It can be configured in xml or yml, or it can be configured in the DependencyInjection file

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template