1
josh_cui
Re: A question about smarty variable
  • 2010/10/11 23:18

  • josh_cui

  • Just popping in

  • Posts: 2

  • Since: 2010/10/4


It worked!! Thank you very much, zyspec.



2
josh_cui
A question about smarty variable
  • 2010/10/10 18:35

  • josh_cui

  • Just popping in

  • Posts: 2

  • Since: 2010/10/4


Hello Everyone,

I have the following problem with smarty variables.

In my toy example,

I have the following lines in xoops_version.php
// Templates

$modversion['templates'][1]['file'] = 'interface_index.html';

$modversion['templates'][1]['description'] = '';

I have the following lines in my index.php

$xoopsOption['template_main'] = 'interface_index.html';
.....

$xoopsTpl->assign('uid', $uid);
.....

And, I have the following definition in interface_index.html

<{$uid}>

Up to here, everything works fine. It outputs a userID.

BUT, if I change the variable name $uid in interface_index.html to, say $uid1,

then, the following will not work.

In index.php
$xoopsTpl->assign('uid1', $uid);

In interface_index.html
<{$uid1}>

There is not output.

Moreover, if I try the following line in index.php,
$xoopsTpl->assign('uid', $uid);

and the content of interface_index.html is STILL <{$uid1}>.

It will output the userID.

I just wonder if there is a buffer mechanism that remembers my first declaration of $uid in interface_index.html?

Please let me know what is wrong here.

Many thanks in advance,
Josh







TopTop



Login

Who's Online

138 user(s) are online (66 user(s) are browsing Support Forums)


Members: 0


Guests: 138


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