1
kalamata
PHP variables in templates?
  • 2007/1/12 13:21

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

Would it be possible to use PHP variables in block templates? The problem I am having is as follows: I want to give my users the option of switching between themes - however the template as it stands at the moment changes the template but takes you back to the index page. So, if the user was looking at the guestbook module he has to navigate back to it after changing the theme.

To solve that, I tried to replace index.php with <?php echo $PHP_SELF ?>, but the template simply refused to work. The action file does not have to be index.php as any file you replace it with (e.g. www.mysite.com/modules/xfguestbook) will work as well - my understanding is that theme selection happens in header.php and all files import it in one or another way.

How can I resolve this?

I look forward to hearing from you soon.

Thanks in advance.

George

2
frankblack
Re: PHP variables in templates?
  • 2007/1/12 13:57

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


<{php}>...here goes your php code...<{/php}>


allows PHP inside templates

http://smarty.php.net/manual/en/language.function.php.php
http://smarty.php.net/manual/en/tips.componentized.templates.php

These are nice tutorials, but be aware that the syntax is different (< before { and > after }).

3
kalamata
Re: PHP variables in templates?
  • 2007/1/12 14:28

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Works like a charm - many thanks!!!

George

Login

Who's Online

160 user(s) are online (85 user(s) are browsing Support Forums)


Members: 0


Guests: 160


more...

Donat-O-Meter

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

Latest GitHub Commits