V
V
Vitaly2015-01-15 20:02:10
PHP
Vitaly, 2015-01-15 20:02:10

Smarty REQUEST_URI and regular expressions?

Hello, there is an if-elseif construct:

{if $smarty.server.REQUEST_URI == '/'}
---
{elseif $smarty.server.REQUEST_URI == '/page_16.html'}
---
{/if}

Can you tell me how to make $smarty.server.REQUEST_URI == '/page_16.html for all pages like page_xxx.html ?
This option does not work:
---
{elseif $smarty.server.REQUEST_URI == '/page_\d+\.html'}
---

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2015-01-15
@OnYourLips

You don't need to do this in the template. Do not check the address in it.
Check IDs and compare routes. But not parts of addresses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question