You are here: Problem with assign_by_ref « Smarty Templates Posts « IT news, forums, messages
Problem with assign_by_ref

Posted by Jean-Sιbastien Guay on 04/30/05 00:11

Hello,

I'm relatively new to Smarty, and I'm having trouble with assign_by_ref.
Here's the situation.

I'm passing a hash to a member function that looks like this :
public function presentResult( $result ) {
foreach ( $result as $key => $value ) {
self::$smarty->assign_by_ref( $key, $value );
}

self::$smarty->display( 'index.tpl' );
}

I was using assign() before, instead of assign_by_ref(), and it worked
fine. But now I want to pass objects to Smarty as well as simple
scalars, so I changed it to assign_by_ref() for all variables (since I
don't modify any variables in templates, it doesn't really matter). Now,
it seems as if none of my variables are making it to Smarty... If I look
at the debug pop-up, all the variables show up as empty...

Am I doing something wrong? I assume something like this should work...

Thanks in advance,

J-S

--
___________________________________________
Jean-SΓ©bastien Guay jean_seb@videotron.ca
http://whitestar02.webhop.org/



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.0 - Release Date: 2005/04/29

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация