Re: [SMARTY] Re: call to class/method

From: Date: Sun, 15 Dec 2002 01:05:29 +0000
Subject: Re: [SMARTY] Re: call to class/method
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6800@lists.php.net to get a copy of this message
Hallo! [sorry, I forgot to answer to the list ;-), but I also added some contend]
The other way is to use {insert} and then, from the insert function, return the data you gathered from the other function you wanted to call. This way you can keep your designers from seeing any PHP and having too much access to code and whatnot.
But this way I only can use a functions. What I want to do is use a method of a class. {insert} works like that: {insert name="getBanner" lid=#banner_location_id# sid=#site_id#} will do that: insert_getBanner(array("lid" => "12345","sid" => "67890")); What I need is: $my_class -> insert_getBanner(); Or can I somehow build an own plugin for smarty which behaves like that? Something like: {insert_from_class method="getBanner"} $insert_from_class -> getBanner(); I want to do this, because I´m working on a completly modul-based PHP-project. The differnt modules have two files, one file only with a php-class, and one template-file. The main-modul loads the class and the template, and the template should only use PHP inside the own modul-class. Thank you very much! regards Andreas

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