1
a1fred
how to displace some value in a template ?
  • 2004/1/29 13:34

  • a1fred

  • Just popping in

  • Posts: 5

  • Since: 2004/1/17


Hello all,
I am learning how to write a module for Xoops,
but get stuck.

in a php file i have a line
$xoopsTpl->assign('info'$info);


in another template file i have a line
<?php echo $this->_tpl_vars['info']; ?>


I suppose the line in the template will be replaced by the value stored in $info, but it doesnt and shows nothing.
what 's wrong ?

Can anybody point me a direction ?

2
Dave_L
Re: how to displace some value in a template ?
  • 2004/1/29 13:50

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


In the template, instead of
<?php echo $this->_tpl_vars['info']; ?>
you should have
<{$info}>

3
Mithrandir
Re: how to displace some value in a template ?

I believe the
echo $this->_tpl_vars['info'];

is a template AFTER compilation.

If you assign the variable to $xoopsTpl in the php code, you should access it in the template with <{$variablename}> as Dave said.

4
a1fred
Re: how to displace some value in a template ?
  • 2004/1/29 14:31

  • a1fred

  • Just popping in

  • Posts: 5

  • Since: 2004/1/17


Thanks all.
It is very helpful.

Login

Who's Online

90 user(s) are online (56 user(s) are browsing Support Forums)


Members: 0


Guests: 90


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