1
raggarsvin
passing value from template to php
  • 2008/11/27 10:25

  • raggarsvin

  • Just popping in

  • Posts: 13

  • Since: 2007/8/8 9


i just cant figure out how to pass values used in the template file to php code i have in the same file, for ex:
<{assign var="passback" value=$link.title_s}>

<{
php}>
echo 
$passback;
</
php}>

that echoes nothing, if i use
<{$passback}>

it prints out, but i need the value in the php code.

please help me, i cant figure it out

2
frankblack
Re: passing value from template to php
  • 2008/11/27 11:10

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Like this?
<{assign var="passback" value=$link.title_s}>
<{
php}>
  echo 
$this->get_template_vars('passback');
<{/
php}>

3
raggarsvin
Re: passing value from template to php
  • 2008/11/27 11:19

  • raggarsvin

  • Just popping in

  • Posts: 13

  • Since: 2007/8/8 9


omg so brilliant and easy, now why didnt i figure that out =)
it worked like a charm.
Im Wery gratful, thanks alot for that, google throu +100 pages already

4
frankblack
Re: passing value from template to php
  • 2008/11/27 11:22

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Add THIS and THIS to your bookmarks.

5
demian
Re: passing value from template to php
  • 2012/3/24 17:35

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


hi

im a php newbie

what if i have this value of <{$event.event_etablissement}>

how do i past this to php ?

6
demian
Re: passing value from template to php
  • 2012/3/24 17:54

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29


ok i get it

<{assign var="loc" value=$event.event_etablissement}>
<{
php}>
  echo 
$this->get_template_vars('loc');
<{/
php}>

Login

Who's Online

156 user(s) are online (114 user(s) are browsing Support Forums)


Members: 0


Guests: 156


more...

Donat-O-Meter

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

Latest GitHub Commits