Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Direct Access to Variable

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Sat Jun 21, 2014 3:31 am    Post subject: Direct Access to Variable Reply with quote

In the doc page:
http://www.smarty.net/docs/en/variable.template.dir.tpl
a comment is made that "As of Smarty 3.1 the attribute $template_dir is no longer accessible directly."

Yet I see many working examples in these forums of:
$Smarty->template_dir = "something";

If this is not direct access, what would an example be that I can no longer use?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Jun 21, 2014 4:56 am    Post subject: Reply with quote

The template_dir folders and other needs to be sanitized and some other action is necessary when the folders are changed. For this
reasion we introduced the setter/getter functions.

But you still direct access the property as the access gets mapped by the magic __get() __set() functions to the setter/getter.

But you do loose some performance...
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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