Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Any updates on Smarty 3.2?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
rudder
Smarty Rookie


Joined: 20 Oct 2009
Posts: 12

PostPosted: Fri Apr 07, 2017 12:09 am    Post subject: Reply with quote

Hi AnrDaemon, thanks for being active on this thread.

Could you give the community an update on 3.2 and especially on the support of namespaces?

Specifically it'd be really nice to do something like {\Tools\Help::print_help()}
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1022

PostPosted: Fri Apr 07, 2017 10:46 am    Post subject: Reply with quote

rudder wrote:
Hi AnrDaemon, thanks for being active on this thread.

Could you give the community an update on 3.2 and especially on the support of namespaces?

I'm a forum modeator, not a developer. Sorry if disappointed.

Quote:
Specifically it'd be really nice to do something like {\Tools\Help::print_help()}


You can do it.

$smarty->registerPlugin('function', 'print_help', ['\Tools\Help', 'print_help']);

{print_help}

Doing it directly is not a very sane idea, as it opens up a can of worms Smarty is intended to avoid. I.e. a temptation to overload templates with business logic.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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