1
hrbhot
Re: <{if $smarty.server.PHP_SELF=='/index.php'}> not working
  • 2012/11/9 0:55

  • hrbhot

  • Just popping in

  • Posts: 1

  • Since: 2012/11/9


you might be needing the leading slash on the REQUEST_URI environmental...

{if $smarty.server.REQUEST_URI == '/index.php'}


-or-

{if $smarty.server.REQUEST_URI|strstr:'index.php'}


-or-

{if $smarty.server.REQUEST_URI|strpos:'/index.php' === 0}


A cleaner approach would be to assign "page" variable to the smarty instance

$smarty->assign('page','index');


in which you can then test

{if $page == 'index'}


As any additional query string parameters on your index page will cause your very explicit match to fail




TopTop



Login

Who's Online

58 user(s) are online (37 user(s) are browsing Support Forums)


Members: 0


Guests: 58


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits