Y
Y
YariKartoshe4ka2019-09-22 22:33:07
Silex
YariKartoshe4ka, 2019-09-22 22:33:07

How to display your 404 in silex php?

I came up with this thing after all the views:

$app->get('/{other}', function() use($app) {
    return $app['twig']->render('404.twig');
});

But it only works for this url: site.domain/test, and it doesn't work for site.domain/test/test. How can I fix this or are there other implementation suggestions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolay, 2019-09-23
@YariKartoshe4ka

You are moving in the wrong direction a bit.
Try to do as indicated in the documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question