|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mann.fr Smarty n00b
Joined: 14 May 2003 Posts: 1
|
Posted: Wed May 14, 2003 2:07 pm Post subject: Forms generation and validation |
|
|
Hi,
I chose to use a template for my form
and a template for my page
is this a good idea ?
Here is what it looks like :
page.tpl "<HTML><BODY>FORM<BR/>{$the_form}</BODY></HTML>"
form.tpl "
{label for="a_feild"} : {input name="a_feild"} <BR/> {input name="a_select"}
page.php
require_once ("my_smarty_classe.php");
require_once ("my_forms_classe.php");
$my_smarty = new My_Smarty_Class();
...
$my_form = new My_Form_Class("form.tpl");
$my_form->AddInput(array(...));
$my_form->AddInput(array(...));
$my_form->LoadInputValues();
$my_form->Load();
// This loads the HTML source of the form of form.tpl
// in a global variable $the_form
$my_smarty->assign("the_form",$the_form);
$my_smarty->dislay();
I don't think using two Smartys is too smart !
And what do you think ?
Pls help ... |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|