Здравствуйте, уважаемые знатоки. Подскажите мне, пожалуйста что я делаю не так и как победить эту ошибку:
Catchable Fatal Error: Argument 1 passed to Allergo\MainBundle\Controller\HomePageController::__construct() must be an instance of Allergo\MainBundle\Entity\CategoryRepository, none given, called in /var/www/allergo.loc/app/cache/dev/classes.php on line 2456 and defined
а вот сам код:
.../Resourse/config/controllers.yml
services:
allergo_main.home_page_controller:
class: Allergo\MainBundle\Controller\HomePageController
arguments: [ @repository.category ]
../Resourse/config/repositories.yml
services:
repository.category:
class: Allergo\MainBundle\Entity\CategoryRepository
factory_service: doctrine.orm.entity_manager
factory_method: getRepository
arguments: [ Allergo\MainBundle\Entity\Category ]
# .../Resourse/config/services.yml
imports:
- { resource: repositories.yml }
- { resource: controllers.yml }
services:
# allergo_main.example:
# class: Allergo\MainBundle\Example
# arguments: [@service_id, "plain_value", %parameter%]
../Controller/HomePageController.php
/**
* @var CategoryRepository
*/
private $categoryRepository;
/**
* @param CategoryRepository $categoryRepository
*/
public function __construct
(
CategoryRepository $categoryRepository
)
{
$this->categoryRepository = $categoryRepository;
}
app/config/config.yml
imports:
- { resource: "@AllergoMainBundle/Resources/config/services.yml" }
- { resource: parameters.yml }
- { resource: security.yml }
....