I
I
ILoveYAnny2016-12-21 20:11:03
PHP
ILoveYAnny, 2016-12-21 20:11:03

How to organize the correct page routing in Twig?

Hello, I was thinking about the correct Routing and thoughts came only through htaccess to direct them to a specific script, something like

RewriteRule ^page/(.*)$ /pages/page.php?id=$1 [NC,L]

But I feel that there is a more elegant solution, because if there are a hundred such cases .. As I think, there should be one index.php entry point, everything goes to it, the URL is built there and Render is sent to Twig, however how to build a url and render by this url and so that the user at the end sees the result of the render by the constructed url, I’ll never know ..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question