Current time: 12-23-2024, 01:10 PM Hello There, Guest! (LoginRegister)


Post Reply 
Convert pTemplates into Smarty Templates
Author Message
zpin Offline
Junior Member
*****
Dev Team

Posts: 160
Joined: Sep 2007
Reputation: 1
Post: #31
RE: Convert pTemplates into Smarty Templates
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
10-20-2010 09:08 PM
Find all posts by this user Quote this message in a reply
Obi_Wan Offline
Junior Member
*****
Dev Team

Posts: 64
Joined: Sep 2007
Reputation: 0
Post: #32
RE: Convert pTemplates into Smarty Templates
Already had a look at the branch.

So all the templates and PHP files have already been converted?
10-20-2010 09:20 PM
Find all posts by this user Quote this message in a reply
zpin Offline
Junior Member
*****
Dev Team

Posts: 160
Joined: Sep 2007
Reputation: 1
Post: #33
RE: Convert pTemplates into Smarty Templates
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.
10-20-2010 09:30 PM
Find all posts by this user Quote this message in a reply
Obi_Wan Offline
Junior Member
*****
Dev Team

Posts: 64
Joined: Sep 2007
Reputation: 0
Post: #34
RE: Convert pTemplates into Smarty Templates
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.
10-20-2010 09:45 PM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #35
RE: Convert pTemplates into Smarty Templates
(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
10-20-2010 09:59 PM
Quote this message in a reply
RatS Offline
Project Leader
******

Posts: 1,854
Joined: Oct 2006
Reputation: 17
Post: #36
RE: Convert pTemplates into Smarty Templates
(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.
(This post was last modified: 10-21-2010 01:45 AM by RatS.)
10-20-2010 10:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zothos Offline
Release Manager
*****
Dev Team

Posts: 1,262
Joined: Feb 2007
Reputation: 10
Post: #37
RE: Convert pTemplates into Smarty Templates
small grammar correction.

I'm looking forward to see this in our trunk Smile
10-20-2010 11:09 PM
Find all posts by this user Quote this message in a reply
Obi_Wan Offline
Junior Member
*****
Dev Team

Posts: 64
Joined: Sep 2007
Reputation: 0
Post: #38
RE: Convert pTemplates into Smarty Templates
(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
10-21-2010 05:45 PM
Find all posts by this user Quote this message in a reply
kassah Offline
Junior Member
*

Posts: 46
Joined: Oct 2010
Reputation: 1
Post: #39
RE: Convert pTemplates into Smarty Templates
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
11-03-2010 01:23 PM
Find all posts by this user Quote this message in a reply
zpin Offline
Junior Member
*****
Dev Team

Posts: 160
Joined: Sep 2007
Reputation: 1
Post: #40
RE: Convert pTemplates into Smarty Templates
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.
11-03-2010 09:03 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: