Я пытаюсь использовать учение в моем проекте API симфони, у меня есть контроллер, но, когда она называется, я получаю ошибку «ServiceNotFoundException»Symfony 2 ServiceNotFoundException
<?php
namespace Cogc\EnquirerAPIBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
use Doctrine;
class PageController extends FOSRestController
{
public function getPageAction($id)
{
return $this->container->get('doctrine.entity_manager')->getRepository('Page')->find($id);
}
}
попробуйте демпинг сервисного deifinition контейнера с помощью командной строки, как ' php app/console container: debug 'В моем случае служба называется' doctrine.orm.entity_manager' – Matteo
Ahh, Это сработало. Спасибо – aaaa
ok, я отправлю свой комментарий в качестве ответа, чтобы вы могли закрыть вопрос – Matteo