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


hhttp://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}>

<{if $block.title|truncate:1:"" != "!"}>
title-comp-<{$block.code}><{/if}>" onclick="collapse()" ondblclick="collapse()" unselectable="on">
<{$block.title}>
<{php}>echo $array;<{/php}>



<{/if}>
<{$block.content}>


<{/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

365 user(s) are online (256 user(s) are browsing Support Forums)


Members: 0


Guests: 365


more...

Donat-O-Meter

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

Latest GitHub Commits