Re: call to class/method

From: Date: Sun, 15 Dec 2002 00:13:11 +0000
Subject: Re: call to class/method
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6798@lists.php.net to get a copy of this message
Akorthaus@Web.De wrote:
Hi! Is it possible to get data into a smarty-template by calling al class-method direktly? I would like to place a "CALL" inside the template, which directly gets its data form a function inside a class, or is it only possible to write the result of the funktion into a variable and use this value? regards Andreas
There are two options that I can see for doing what you want to do. The first one is perhaps the more ugly. You can put PHP code into your template and call PHP functions and classes from there using the {php}{/php} tags. 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. I hope that one of those two ways helps you. Regards, Paul

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