->andWhere('pb.active = :active')
->andWhere('pb.id_page = :id')
->andWhere('p.active = :active')
->setParameter('url', $url)
->setParameter('active', '1')
->setParameter('id', $id)
->setParameter('active', '1')
->innerJoin('App\Entity\Page', 'p', 'pb.id_page = p.id')
->leftJoin('App\Entity\Block', 'b', 'WITH', 'pb.block = b.id')
->orderBy('pb.sort', 'ASC')
->getQuery()
/**
* @Route("/p/{url}", name="builder_page")
*/
public function show(PageRepository $pageRepository, $url): Response
{
$page = $this->getDoctrine()->getRepository(PageBlock::class)->findByPageBlock(['url' => $url]);
$menu = $this->getDoctrine()->getRepository(Page::class)->findByPageMenu();
foreach ($page as $key => $item) {
$name = $item['name'];
$description = $item['description'];
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
<?php
use App\Kernel;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
No log messages
ErrorException
|
---|
ErrorException: Notice: Undefined variable: id at src/Repository/PageBlockRepository.php:45 at App\Repository\PageBlockRepository->findByPageBlock(array('url' => 'developer-dmitriy.belousov')) (src/Controller/BuilderControllers/PageController.php:19) at App\Controller\BuilderControllers\PageController->show(object(PageRepository), 'developer-dmitriy.belousov') (vendor/symfony/http-kernel/HttpKernel.php:152) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/var/www/u0948338/data/www/getcreate.ru/vendor/autoload_runtime.php') (public/index.php:5) |