[SMARTY-GENERAL] MOre about Form Plugin
| From: | Roberto Berto | Date: | Fri, 05 Apr 2002 10:33:26 +0000 |
| Subject: | [SMARTY-GENERAL] MOre about Form Plugin | ||
| Groups: | php.smarty.dev php.smarty.general | ||
| Request: | Send a blank email to php-smarty-dev+get-41@lists.php.net to get a copy of this message | ||
It doesnt save the field values.
Every time template is open, it is processed and the script get the steps.
If the script wants, it will get the values of some step.
I tryed to make Form Plugin modular like the plugins architeture.
To save the fields, we need save at a BD or a file and add a ID field to the
form. I can do, but, who will use? Will eat some computer aditional
processment.
What about add a plugin variable inside Form Plugin that tell you the
current status
and if you have sucess or not?
Something like:
global $smarty_form;
print $smarty_form->step;
print $smarty_form->sucess;
So you can track if you want do something.
Maybe whe can load the class inside $smarty. Something like:
$smarty->form->step and $smarty->form->sucess;
What you thing about all these things?
Atenciosamente,
----------------------------------------
Roberto Bertó
Under Development
http://www.under.com.br
Tel: 51 32270599
Cel: 51 91169628
----- Original Message -----
From: "Valerio Santinelli" <tanis@mediacom.it>
To: "Roberto Berto" <roberto@berto.net>; <smarty-general@lists.php.net>
Sent: Friday, April 05, 2002 4:07 AM
Subject: Re: [SMARTY-GENERAL] Preview of Form Plugin
> Do you save all the fields values from one step to the next?
> It would be nice to be able to collect data in a persistent way so that
the
> user can step forward and backward and still retain entered values. That
way
> you could save everything during the final step.
>
> --
> Valerio Santinelli
> HateSeed.com Founder (http://www.hateseed.com)
> In Flames Italia Webmaster (http://www.inflames.it)
> My Lab (http://tanis.hateseed.com)
>
> ----- Original Message -----
> From: "Roberto Berto" <roberto@berto.net>
> To: <smarty-general@lists.php.net>
> Sent: Thursday, April 04, 2002 10:11 PM
> Subject: [SMARTY-GENERAL] Preview of Form Plugin
>
>
> > Note:
> >
> > The Form Plugin isn't only a custom function, but a set of custom
> functions
> > and a prefilter.
> >
> >
> > Download:
> >
> > http://www.under.com.br/ourcms/form_plugins-release_alpha.zip
> >
> > Installation:
> >
> > All php files should be added to your smarty plugin directory. There are
a
> > .tpl example. Try run it to see the Form Plugin in action.
> >
> >
> >
> > Purpose:
> >
> > Make all the Form Validation - server and client side (todo)
> > Printout Validation errors together to the Form if error
> > Process the Current Form Step and increment Step counter if no error
> >
> >
> >
> > Form Overview:
> >
> > {formprocessor name="ProcessorOne"}
> > {step}
> > {form name="formTest" action="form.php" method="get"}
> > {if $form_sucess == FALSE}
> > {section name=error loop=$form_errors}
> > {$form_errors[error].element}
> > {$form_errors[error].key}
> > {$form_errors[error].value}
> > {/section}
> > {/if}
> > {/form}
> > {/step}
> > {step}
> > {form name="formTest" action="form.php" method="get"}
> > {/form}
> > {/step}
> > {/formprocessor}
> >
> >
> > - Allways start and end with {formprocessor} tag. This tag may have a
name
> > attribute.
> > - You can add how many steps you want. {step} is required. Min steps is
> two.
> > - You can add text before {form} and after {/form}
> > - If form return error, $form_sucess will be FALSE
> > - The errors will be assigned to $form_errors and will have tree
> parameters:
> > element - is the name of the form element that have error
> > key - is the validation type part
> > value - is the validation value part
> >
> > All form tags need be called from {} instead <>. If you want a tag have
> > validation, you should add
> > the attribute validation to it.
> >
> > Eg:
> > {input type="text" name="name" value=$smarty.request.name
> > validation="min_lenght=4&max_lenght=20"}
> > Where min_lenght is the type part of validation and 4 is the value part.
> >
> > The validation will be both min_lenght more than 4 and max_lenght more
> than
> > 20.
> >
> >
> >
> > Each validation type will be a file at plugins dir named:
> > shared.validation.TYPE.php
> >
> > And the function name should be:
> > smarty_validation_NAME
> >
> > Will be passed two parms to the functions:
> > $element, $value
> >
> > $element is the element name. Should be used a $_REQUEST["$element"] to
> get
> > it value
> > $value is the value part of validation that is used to compare
something.
> >
> > The function should return FALSE if want return a error, or TRUE if dont
> > will
> > return error. Set of TRUE and FALSE is required.
> >
> >
> > More details soon.
> >
> >
> >
> >
> > TODO:
> >
> > - add more validation functions
> > - create javascript part
> > - add some javascript validations
> > - add "auto complete" to change the input value="" and input
type=checkbox
> > and radio CHECKED, etc - when error
> >
> >
> > Please, comment the Form Plugin. I'm needing your feedback.
> >
> >
> >
> >
> >
> > Atenciosamente,
> >
> > ----------------------------------------
> > Roberto Bertó
> >
> > Under Development
> > http://www.under.com.br
> >
> > Tel: 51 32270599
> > Cel: 51 91169628
> >
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
Atenciosamente,
----------------------------------------
Roberto Bertó
Under Development
http://www.under.com.br
Tel: 51 32270599
Cel: 51 91169628