Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Using Smarty in class or function files...

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Lord Yggdrasill
Smarty Rookie


Joined: 31 Mar 2012
Posts: 15

PostPosted: Sat Mar 31, 2012 5:26 pm    Post subject: Using Smarty in class or function files... Reply with quote

Well my script has site content being modified through accessing classes methods. For instance, the Shop class has a method called listshop() which shows a table of all available shops, and displayshop() which displays the items sold in one specific shop. When a class method like these is called, there is no need to echoing site content in main script.

If I want to use Smarty on my site, do I have to modify every class file to accept a smarty argument and store a public property $smarty? For instance, my shop constructor currently only accepts a $shopname argument __construct($shopname), do I have to chance it to something like __construct($smarty, $shopname) and have $smarty stored as an object property? Just curious, I was wondering if smarty title and content can be accessed without passing smarty object into another class or function.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP