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.
Namespace support

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


Joined: 11 Dec 2010
Posts: 30

PostPosted: Mon Apr 30, 2012 9:16 am    Post subject: Namespace support Reply with quote

HI All,

a few months ago I said I was going to release a framework which makes use of the Smarty library. After a release candidate which I felt could be improved, anyway more to the subject of Smarty..

My framework makes use of Namespaces. There's application logic and packages.

Smarty is imported as a package, and used by the core package.

What's the easiest way of namespacing Smarty without modifying the core files and losing the changes when I upgrade each release? Or would Smarty be able to support namespacing?
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 698
Location: Germany, border to Switzerland

PostPosted: Mon Apr 30, 2012 9:35 am    Post subject: Reply with quote

There are two sides to namespaces with Smarty.

1) exposing / encapsulating Smarty itself in a namespace.

As Smarty3 is PHP5.2 compatible, this is simply not going to happen any time soon. As sad as this makes me myself, I don't think it's going to happen for Smarty3. Reason: quite slow adoption rate of major PHP releases. Too many people are still running old PHP versions.

2) accessing namespaced elements.

We're working on improving our APIs so namespaced functions can be registered, so templates can understand namespaced classes and constants. But these improvements won't be available any time soon.
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
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