Re: Starting with a new project...
| From: | Markus Wolff | Date: | Sat, 31 May 2003 15:13:19 +0000 |
| Subject: | Re: Starting with a new project... | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-5727@lists.php.net to get a copy of this message | ||
Nikhil G. Daddikar wrote:
I am starting with a new website using PHP+Pear modules. I've been a java servlets person and would appreciate greatly your help/experiences on the following: * choosing a persistence layerHave a look at DB_DataObject, this should do what you need.
* choosing a templating systemUh, this is a difficult question - one of those that can start World War III, like "My Amiga is better than your PC" (which was of course very much true at the time and still is in some areas... wait, what am I doing... help!! Run!!) or "Linux is better than Windows" (which I could comment on as well, but I won´t because of the imminent danger...) ... well, you see the point? ;-) Honestly, it highly depends on what you want. Each engine follows a slightly different philosophy. If you´re one of those types who want to keep _all_ the logic in the PHP code and have pure HTML in their templates, one of these engines are for you: - HTML_Template_IT - HTML_Template_ITX - HTML_Template_PHPLib - HTML_Template_Sigma These engines allow only placeholders and repeatable blocks, ITX and Sigma even support callback functions which come in handy for small things like changing background colors for alternating table rows etc. IT, ITX and Sigma share a similar API, so switching between them should be possible without much trouble. Performance-wise, Sigma with activated caching should be the quickest. If you want to be able to have complex logic within your templates (which I don´t recommend if you ever want to let the templates be made by some graphics artist who knows his HTML but has NO CLUE about program logic, scripting and the like - but actually a lot of people want this kind of feature), you should have a look at one of these engines: - Smarty (not in PEAR, but here: http://smarty.php.net/) - HTML_Template_Flexy - HTML_Template_Xipe Coming from JSP, you´ve probably not worked with templates before, but used taglibs instead. You can of course do the same in PHP, using the package XML_Transformer, which allows you to build your own taglibs by mapping PHP objects to XML namespaces.
* choosing a web-form helper (data validation etc.)Here you have the choice between one of these: - HTML_OOH_Forms - HTML_Quickform What you use is merely a matter of taste. Both packages have their own pro´s and con´s. While Quickform is available as a PEAR package, OOH can only be obtained by PEAR CVS right now. OOH has a good and quite complete documentation, but unfortunately it´s available in German only at http://www.ulf-wendel.de/. Quickform´s docs are yet to come, but there are plenty of example scripts that will get you up and running in no time.
* setting up the build system & directory structureDefine build system. If all you want is an easy way to distribute and install your apps, the PEAR installer is all you will need. If you´re searching for a "real" build system, you might wanna have a look at Phing, which you can find at http://binarycloud.com/phing/builds/ and obtain more info on at http://webstract.org/. Phing is not a part of PEAR, but part of the Binarycloud project.
I am bit confused since there are a lot of choices for this stuff out there and I am sure you folks must have evaluated this before.Correct me if I´m wrong, but doesn´t the Java platform offer quite some choice as well? ;-) Regards, Markus