ispCP - Board - Support
Convert pTemplates into Smarty Templates - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: General discussion (/forum-11.html)
+--- Thread: Convert pTemplates into Smarty Templates (/thread-11726.html)

Pages: 1 2 3 4 5


RE: Convert pTemplates into Smarty Templates - zpin - 10-20-2010 09:08 PM

Just a heads up for anyone interested in this change: The patch has been integrated into a branch for a while now and is ready to be tested.

The goal of this patch has been to get the ispCP GUI to work with Smarty templates as easily as possible. Since this goal has been reached I'm now open to suggestions on how to improve the Smarty implementation.

I'm currently testing the branch for functionality whenever I find some spare time but as mentioned before I would be glad for others to test it as well.

You can check out the branch here:
http://www.isp-control.net:800/ispcp_svn/branches/zpin


RE: Convert pTemplates into Smarty Templates - Obi_Wan - 10-20-2010 09:20 PM

Already had a look at the branch.

So all the templates and PHP files have already been converted?


RE: Convert pTemplates into Smarty Templates - zpin - 10-20-2010 09:30 PM

Yes, everything should be converted. I've made a script to do the conversion on all files and then manually corrected all the errors & corner cases. As far as my testing goes it seems to work.
I have another change that I'll commit in a minute, adding the "compiled" directory and setting the right permissions.


RE: Convert pTemplates into Smarty Templates - Obi_Wan - 10-20-2010 09:45 PM

Sounds good Smile I wonder when it is planned to integrate it into trunk.

I'll install the branch on my testserver this afternoon if I have time.


RE: Convert pTemplates into Smarty Templates - Nuxwin - 10-20-2010 09:59 PM

(10-20-2010 09:45 PM)Obi_Wan Wrote:  I wonder when it is planned to integrate it into trunk.

NEVER ! ! ! Tongue Big Grin Tongue Big Grin Tongue


RE: Convert pTemplates into Smarty Templates - RatS - 10-20-2010 10:56 PM

(10-20-2010 09:59 PM)Nuxwin Wrote:  
(10-20-2010 09:45 PM)Obi_Wan Wrote:  I wonder when it is planned to integrate it into trunk.

NEVER ! ! ! Tongue Big Grin Tongue Big Grin Tongue

Do not consider this as an official statement. The integration need to be planned wisely, so we cannot give a proper date.


RE: Convert pTemplates into Smarty Templates - Zothos - 10-20-2010 11:09 PM

small grammar correction.

I'm looking forward to see this in our trunk Smile


RE: Convert pTemplates into Smarty Templates - Obi_Wan - 10-21-2010 05:45 PM

(10-20-2010 09:59 PM)Nuxwin Wrote:  
(10-20-2010 09:45 PM)Obi_Wan Wrote:  I wonder when it is planned to integrate it into trunk.

NEVER ! ! ! Tongue Big Grin Tongue Big Grin Tongue

Haha that really sounds like my work as "IT-Guy" at my company. You can prepare new and shiny systems and they will NEVER be implemented Big Grin Tongue

Btw: why won't I get an email notification on new replies? Sad


RE: Convert pTemplates into Smarty Templates - kassah - 11-03-2010 01:23 PM

I'm putting in my 10 cents here because I put it in another thread, and figured I should put it here too for those who want to listen.

I'm not a particular fan of Smarty, because the more advanced your usage of it, the harder it becomes to debug. Because there is no such thing as debugging symbols in it's compiled PHP code, even once you figure out where an issue is in it's generated php, it can be difficult to figure out what line in the Smarty template is responsible.

This is why I'm a big proponent of simple phtml files. Simple PHP mixed with HTML. This is how ZendFramework does it, but by no means do you need ZendFramework to do it.

Using phtml would also make fixing gettext to scan the new templates very easy (it's just more php!) for a change like in my other thread.

Ref: Thoughts about moving translation call to inside gui template


RE: Convert pTemplates into Smarty Templates - zpin - 11-03-2010 09:03 PM

Generally, I agree with you. I've never had much trouble on the debugging front with Smarty but the more complex the template "language" becomes the less it's justified over simply using PHP.
The advantages I see: simpler syntax ({$X} instead of <?php echo $X ?>) and (still) restricted functionality.
In this case I took Smarty because it's syntax resembles the current pTemplate syntax and the changes in the .php files were minimal. It was the most efficient way to improve the templating situation.
Also in our case the goal is to not even get into these debugging problems by keeping the use simple. Actually, this should always be the goal. If your templates get too complex you might be doing it wrong.