Page 2 of 2

Posted: Thu Dec 15, 2005 6:28 am
by Maugrim_The_Reaper
What are the key advantages to using Savant over just putting PHP code in your templates? What does PEAR have to do with Savant?
Check who the author is...;) Savant can be installed via PEAR, or included like any library outside PEAR. As for the advantage to using Savant over just putting PHP in your templates - absolutely none. Savant is pure PHP - it uses no sub-language as a wrapper across PHP.

What Savant does is offer a standardised (read: reusable and simple) approach to including that PHP. Which is basically what most template engines claim to offer - in some way, and actually do (in the cached compiled scripts). It just doesn't claim to separate PHP from HTML which is completely at odds with the true ideal of separating Business Logic from Presentation Logic.

A few other points.

Converting from Smarty to Savant is simple - and I'd recommend having some sort of wrapper (Facade) as a common API to hide which library an application is using. With that - and the relevant templates - you can try out both in similar conditions, or migrate between each as required.

Savant is safe under PHP4 and PHP5 (its error clean except for PHP5 E_STRICT).

If you want to add template security (a common argument for Smarty - probably the only valid one too) Savant allows modules/plugins/extensions. You can add your own compile module for a sub-language if you wish. Point is Savant is pure PHP, unless you specifically want it otherwise - its not forced, and so its ultimately far more flexible than Smarty.
Unlike (ASP), PHP is a language where you can construct your own framework. I think that's what makes it so popular. You can include ADODB, PEAR, SMARTY whatever you like into it.
PHP is just too damn easy - someone should have complicated it enough to force anyone wishing to use the language to use the first framework that appeared...;) If you take the 3rd party library approach - building a framework thats simple and light is simple. Sure it won't be the next Prado or Cake but it'll get the job done - and easier - if you don't need every possible feature...

Posted: Thu Dec 15, 2005 10:54 am
by alvinphp
neophyte wrote:Unlike (ASP), PHP is a language where you can construct your own framework. I think that's what makes it so popular. You can include ADODB, PEAR, SMARTY whatever you like into it. But here again the choice is yours to make. You don't have to depend on a Framework that forces you into a particular design path. In PHP you can make your framework as big or as small as you like it. I may be wrong but I think that these are some of the reasons why no framework like PRADO has emerged as the defacto system. Unless Zend introduces one standard into PHP I doubt one will emerge.

I've looked at the Savant site and I have a couple of questions for those of you who have used Savant. What are the key advantages to using Savant over just putting PHP code in your templates? What does PEAR have to do with Savant?
I disagree, I don't think PHP is popular because you can make your own framework. I think it is popular because it is so easy for a novice to build a dynamic web site. The cost of this is very unstrict rules which is why I shiver when I see some PHP sites.

IMHO, I prefer the single framework of ASP.NET, it makes it so you can do a host of complicated things very easily as everything is integrated in an object based structure. The huge downside for me with .net was that it only works on Windows and the Linux flavors of .net have too many problems.

Posted: Thu Dec 15, 2005 11:31 am
by Maugrim_The_Reaper
Anything you can do, I can do better. So say Zend...
IMHO, I prefer the single framework of ASP.NET, it makes it so you can do a host of complicated things very easily as everything is integrated in an object based structure. The huge downside for me with .net was that it only works on Windows and the Linux flavors of .net have too many problems.
There's an upside??? ;)

Just joking, maybe I just find it hard to take seriously a language which lists IIS as its official platform and has so little support for any OS without a Microsoft sticker on the shiny plastic wrapping.

It is a nicely done language - just not my cup of tea...

Posted: Thu Dec 15, 2005 9:51 pm
by alex.barylski
Maugrim_The_Reaper wrote:Anything you can do, I can do better. So say Zend...
IMHO, I prefer the single framework of ASP.NET, it makes it so you can do a host of complicated things very easily as everything is integrated in an object based structure. The huge downside for me with .net was that it only works on Windows and the Linux flavors of .net have too many problems.
There's an upside??? ;)

Just joking, maybe I just find it hard to take seriously a language which lists IIS as its official platform and has so little support for any OS without a Microsoft sticker on the shiny plastic wrapping.

It is a nicely done language - just not my cup of tea...
BASIC is a ghey syntax...

I could throw stones at my keyboard and the code would compile and run (or just run).... :P

Posted: Sat Dec 17, 2005 11:31 am
by alvinphp
Hockey wrote:
Maugrim_The_Reaper wrote:Anything you can do, I can do better. So say Zend...
IMHO, I prefer the single framework of ASP.NET, it makes it so you can do a host of complicated things very easily as everything is integrated in an object based structure. The huge downside for me with .net was that it only works on Windows and the Linux flavors of .net have too many problems.
There's an upside??? ;)

Just joking, maybe I just find it hard to take seriously a language which lists IIS as its official platform and has so little support for any OS without a Microsoft sticker on the shiny plastic wrapping.

It is a nicely done language - just not my cup of tea...
BASIC is a ghey syntax...

I could throw stones at my keyboard and the code would compile and run (or just run).... :P
When I coded in .net it was in C# which is a C based language. You can also code in J# which is thier flavor of Java. And honestly I had no problem with VB.NET, just a little bit more typing.

Posted: Sat Dec 17, 2005 12:04 pm
by Gambler
Part of the problem I found with frameworks is their scope - are there any truly Lite frameworks that don't include everything plus the kitchen sink?
Well... How light do you want to go? What featureas do you need, and what are you trying to build with the framework?

I'm working on my PHP framework right now, but it's not ready yet. And it won't reach production state any time soon, because it's impossible to find people for design review. But I'm interested in hearing what people need from frameworks, unless they want 100% Rails clone in PHP.

Posted: Mon Dec 19, 2005 4:40 am
by Maugrim_The_Reaper
One pretty neat design feature? The inheritance tree is a maximum 3 deep. At least then its remotely possible for someone to actually RE-USE a component outside the framework as a single purpose work. Why? Because that one of the major advantages of a good OOP design.

If its >3 levels deep it tends to be impossible to re-use - so embedded in the framework that in isolation its not worth the trouble of modifying.

i.e. You must invest in the entire framework to use any portion of its functionality - not always a great thing.

Posted: Tue Dec 20, 2005 2:45 pm
by Christopher
Zend is doing their own framework which will be freely available to all -- just like PHP. I have heard hints that it should be publicly available early next year.

Framework (watch webcast in Extra section):
http://zend.com/collaboration/framework_overview

General Collaboration Site:
http://zend.com/collaboration/