У меня есть только 1 строка в моей базе данных, когда я помещаю этот код в свой AnnouncementController, у меня появляется страница с ошибкой 500.
public function search(AnnouncesRepository $announcesRepository){
$announces = $announcesRepository->findAll();
return $this->render('announces/search.html.twig', ['announces' => $announces]);
}
Журналы:
2019-01-22T12:47:53+00:00 [info] Matched route "announcement_search".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ValidateRequestListener::onKernelRequest".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\SessionListener::onKernelRequest".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\ResolveControllerNameSubscriber::onKernelRequest".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelController".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController".
2019-01-22T12:47:53+00:00 [debug] Notified event "kernel.controller_arguments" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\IsGrantedListener::onKernelControllerArguments".
2019-01-22T12:47:53+00:00 [debug] SELECT t0.id AS id_1, t0.society_id AS society_id_2, t0.job AS job_3, t0.city AS city_4, t0.desired_city AS desired_city_5, t0.slug AS slug_6, t0.user_id AS user_id_7, t0.created AS created_8, t0.description AS description_9, t
0.user_id AS user_id_10 FROM announces t0
[Tue Jan 22 13:47:54 2019] 127.0.0.1:56133 [500]: /rechercher - Allowed memory size of 134217728 bytes exhausted (tried to allocate 65028096 bytes) in C:\wamp64\www\permutation\permutation\vendor\twig\twig\lib\Twig\Extension\Debug.php on line 50
2019-01-22T12:47:54+00:00 [critical] Fatal Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65028096 bytes)
Это работает толькокогда я использую find ($ id) или findOne.
Спасибо за помощь!
Редактировать:
{% for announce in announces %} {{ dump(announce) }} {% endfor %}
Я очистил кеш, и да, увеличение памяти не очень хорошая идея, у меня есть только 1 ряд!В моем шаблоне я тоже пробовал анонсы дампа, но у меня такая же ошибка.Если я удалю дамп, у меня возникнет ошибка.