What is being talked about
- Quickform is a php package lets you generate a form entirely in php.
- Smarty is a templating engine that separates the style and logic, ie php and html, of a web page
Overview of QuickForm2
QuickForm2 lets you create web forms in a simple way, for me it's important features are:
- Create a form without the need to write html. Supports text fields, drop down lists, ...
- The form looks good & clean. I am a programmer, not an arty designer type
- Input field validation - a must to stop you putting rubbish into the database
- Input field validation can additionally be done in the browser - making it nicer for the user
QuickForm2 is part of Pear - the library written in php.
Overview of Smarty
Smarty is a templating engine that separates php code and the html template, ie you have the
logic (php code) and the presentation (html template) in separate files.
- Coder and Designer maintain separate files, you don't mess up each other's work
- Coder and Designer can concentrate on what they are good at
- Common logic can be reused unchanged but with different templates look different, eg login pages on different sites
- Generated php and/or html can be cached, flexibly - you have a lot of control
- Smarty templates can contain presentation logic, eg loops - so display multiple rows from a database search
- Use multiple templates in the construction of one web (.html) file - eg have standard header/footer files
Smarty does not have to be used with QuickForm2.
Return to tutorial home.
If you want any help using the above, or have any comments or suggestions, please contact us.