|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi all,
I have developed a custom template 'engine' to our website. Now, I want to migrate to the Smarty engine. I have read some documentation at your website, however I do not yet know how could I deal with forms processing with smarty. Below you can see an example. Using my custom template, I have to phases: First: Process all forms Second & Last: Displaying the output result Could you point me in the right way to convert the below example to Smarty?.. Any advice?. Maybe an URI to read?. Regards, Davi -- require_once "WebPage.php"; require_once "Person_form.php"; $personForm = new PersonForm(); $webPage = new WebPage($personForm); $webPage->processPage(); $webPage->printPage(); |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Hello,
on 02/10/2006 10:51 AM Davi Leal said the following: > Hi all, > > I have developed a custom template 'engine' to our website. Now, I want to > migrate to the Smarty engine. I have read some documentation at your > website, however I do not yet know how could I deal with forms processing > with smarty. Below you can see an example. > > Using my custom template, I have to phases: > > First: Process all forms > > Second & Last: Displaying the output result > > > Could you point me in the right way to convert the below example to Smarty?. > Any advice?. Maybe an URI to read?. You may want to take a look at this forms generation and validation class. It comes with a Smarty plug-in so you can define your form templates with Smarty. http://www.phpclasses.org/formsgeneration -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Fri, Feb 10, 2006 at 11:11:06AM -0200, Manuel Lemos wrote:
> Hello, > > on 02/10/2006 10:51 AM Davi Leal said the following: > > Hi all, > > > > I have developed a custom template 'engine' to our website. Now, I want to > > migrate to the Smarty engine. I have read some documentation at your > > website, however I do not yet know how could I deal with forms processing > > with smarty. Below you can see an example. > > > > Using my custom template, I have to phases: > > > > First: Process all forms > > > > Second & Last: Displaying the output result > > > > > > Could you point me in the right way to convert the below example to > Smarty?. > > Any advice?. Maybe an URI to read?. > > You may want to take a look at this forms generation and validation > class. It comes with a Smarty plug-in so you can define your form > templates with Smarty. > > http://www.phpclasses.org/formsgeneration I now use quickform to generate/validate forms. It works well and works with smarty. I have a quick demo page: http://www.phcomp.co.uk/TechTutorial/QfSmarty/index.php -- Alain Williams Parliament Hill Computers Ltd. Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ #include <std_disclaimer.h> |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Davi Leal wrote:
> Hi all, > > I have developed a custom template 'engine' to our website. Now, I want to > migrate to the Smarty engine. I have read some documentation at your > website, however I do not yet know how could I deal with forms processing > with smarty. Below you can see an example. > > Using my custom template, I have to phases: > > First: Process all forms > > Second & Last: Displaying the output result > > > Could you point me in the right way to convert the below example to Smarty?. > Any advice?. Maybe an URI to read?. > > Regards, > Davi > > > -- > require_once "WebPage.php"; > > require_once "Person_form.php"; > $personForm = new PersonForm(); > > $webPage = new WebPage($personForm); the WebPage class seems to be a good candidate for making it a Smarty subclass. > $webPage->processPage(); > $webPage->printPage(); if you made WebPage a subclass of Smarty you would probably need to rewrite the printPage() method to assign data to Smarty and output a template and add a std interface (if your using php5 you could really use an interface here!) to any object that might be passed into the WebPage constructor so that you can have the passed object assign any custom data it needs to 'the template' (i.e. to the Smarty object) and tell the WebPage object which [content] template needs to displayed. make sense? > |
|
![]() |
| Outils de la discussion | |
|
|