CodeIgniter Forums
smarty templates with form validation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: smarty templates with form validation (/showthread.php?tid=32020)



smarty templates with form validation - El Forum - 07-10-2010

[eluser]prestondocks[/eluser]
Hi,

I am struggling with using form validation and smarty. I have read a forum topic where two people said it was possible and required assigning the validation object to a smarty variable.

I am however struggling with how to do this.

Could someone provide me with some help.

Thanks
Simon


smarty templates with form validation - El Forum - 07-10-2010

[eluser]WanWizard[/eluser]
Why would you want to do that?

Validation is done after the post of a form, in the controller, outside Smarty.


smarty templates with form validation - El Forum - 07-12-2010

[eluser]prestondocks[/eluser]
What I was looking for was getting the result of the validation into a smarty variable. I have managed to get the validation_string into a variable but I don't know how access the validation object so that I can get field specific errors.


smarty templates with form validation - El Forum - 07-12-2010

[eluser]WanWizard[/eluser]
Two options:

assign the validation result to a smarty template variable before loading the template, or create a smarty function that accesses the form validation library.