Developing miscellaneous classes

From: Date: Wed, 14 Aug 2002 07:47:04 +0000
Subject: Developing miscellaneous classes
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5691@lists.php.net to get a copy of this message
Hey, I have a few classes on my smarty powered site.. And I'm wondering how I modify my classes so that they also work with smarty? Right now, I just work around it and it ain't looking good. For instance, if I have: $class = new class(); $class->printToScreen(); that works, but when I use smarty I cheat and do this: $class = new class(); $_SMARTY->assign("PRINTTOSCREEN", $class->printToScreen()); At first, (when I was using echo in the printToScreen() function, it just placed the text within echo before the templates were parsed. Then I changed it to 'return' and it got placed properly. Now I've come to another problem.. One obviously cannot use return multiple times within one function.. So if anyone can give me some guidelines on how I make custom classes work with smarty that would be great :-) --------------- Sincerely, Eskil Kvalnes eskil@uten.net

« previous php.smarty.general (#5691) next »