1
luisflores
using smarty variable inside {php}
  • 2005/3/16 0:57

  • luisflores

  • Just popping in

  • Posts: 3

  • Since: 2005/3/16


hello

i have a string stored directly on a smarty variable, and i want to do some things with it that require php functions, so, i was wondering how ho handle or pass the value of a smarty variable inside the <{php}><{/php}>

thanks

2
Dave_L
Re: using smarty variable inside {php}
  • 2005/3/16 1:09

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


http://smarty.php.net/manual/en/api.get.template.vars.php

In that example, you'll probably need to use $xoopsTpl instead of $smarty, and you might need to add:

global $xoopsTpl;

3
luisflores
Re: using smarty variable inside {php}
  • 2005/3/16 1:18

  • luisflores

  • Just popping in

  • Posts: 3

  • Since: 2005/3/16


I try to use the function but it breaks, something is now working.

Sorry, this is the first day I use smarty,,,


<{if $block.content != ""}>
<{php}>
$tpl_vars = $smarty->get_template_vars();
<{/php}>
<div class="component medium" draggable="true">
<{if $block.title|truncate:1:"" != "!"}>
<div class="title<{if $block.code != ""}> title-comp-<{$block.code}><{/if}>" onclick="collapse()" ondblclick="collapse()" unselectable="on">
<{$block.title}>
<a class="link"><{php}>echo $array;<{/php}></a>
<div class="expander open" onclick="collapse()" ondblclick="collapse()"></div>
<div class="closer" onclick="closer()" ondblclick="closer()"></div>
</div>
<{/if}>
<div class="content" allowpublicity="yes"><{$block.content}></div>
</div>
<{/if}>

4
luisflores
Re: using smarty variable inside {php}
  • 2005/3/16 1:24

  • luisflores

  • Just popping in

  • Posts: 3

  • Since: 2005/3/16


thanks very much, i did'nt see the code behind your message, it's working!

Login

Who's Online

269 user(s) are online (178 user(s) are browsing Support Forums)


Members: 0


Guests: 269


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