I have just discovered the Smarty template engine - what do ppl reckon to it?
Posted on 2010-01-09
I want to create a commercial website.
There is a script available which does a lot of the donkey work, in PHP. I havn't got the latest version yet, but we do have an very old version (6years?) which was used as the basis for another website we inherited, which is in the same application domain as the one i want to create.
I've hacked away at the existing site as I've been learning HTML, CSS, and PHP, SEO. I've been fixing bugs, adding functionality, and making it SE friendly. Certainly using this site as the basis for the new site is an option, however I've come to realise that the age of the script, and the fixed design of the site, make this a non-favoured option.
If I was going down the PHP route, I'd prefer to get the latest script, and start from scratch in terms of presentation, by hanging a new UI onto it.
A while back I started learning ASP.net, and was encouraged by the apparent seperation of presentation and function offered by the page-behind model. While I'm good at C#, I have to admit that I'm a bit intimidated by ASP.net. Also I'm not aware of any scripts (unlike in the PHP world) that would do a lot of the donkey work, so a lot of the business logic MIGHT (if we don't find any scripts) have to be developed from scratch. There is then the concern that ViewState bloats the HTML output, and could affect SE rankings.
Also there is the fact that I've developed a fair working ability in PHP since I last looked at ASP.net, and would be more confident in PHP. So back to the new PHP script, and hanging a new UI off of it, which is already what I was leaning towards.
Then along comes Smarty... which I've only really started reading about on Friday.
It seems like it does a good job of seperating presentation layer from application logic. However, I don't think the latest version of the PHP script I'm keen on uses smarty at all (the old one certainly didn't and I haven't seen anything in the release notes to indicate the new one does), so the first step would be to seperate all the presentation code in the new script out into templates, and make small alterations to the application code to load the templates and assign the data into them.
Then we could sit down and look at the "distilled" presentation code and analyse it against SEO, design, best practice etc. and it could be amended at will.
Is this going to be a job fraught with issues? Anyone gone down this route before?
Maybe its easier in the long run to leave Smarty out and just hang the UI on the script as is (well not exactly as is as I'll be making business rule amendments to the script in places)
Or is it better to give up on PHP, bite the bullet and go down the ASP.net route.
ASP.net promises the ultimate in flexibility, but probably at the cost of me needing to be fairly expert, as I think I concluded on last evaluation that to get the control over the UI I might want, I'd probably need to extend the controls by derviing new classes from them.
At this stage there is only me on the project, so the seperation into presentation code and application logic will not create an advantage in terms of concurrent progress on both strands that u would have if you had your designer and programmer able to work on each element at the same time (as promised by PHP/smarty and ASP.net done properly - i.e. customising the controls). However design is not my forte, and I might want to outsource this bit towards the end, to get that "agency" look.
OK, a lot above!
Apart from the headline question, I'm also looking for views on ASP.net vs PHP/Smarty.
thanks in advance