CodeIgniter Forums
how i can use validation_errors() in the controller ? - 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: how i can use validation_errors() in the controller ? (/showthread.php?tid=54655)



how i can use validation_errors() in the controller ? - El Forum - 09-18-2012

[eluser]Fahad Alrahbi[/eluser]
Hello ,


i am using Smarty template engine with CI and i want to use validation_errors() inside Controller is it possible ? i want it like this


$error[]=validation_errors();

and in the template i will use {section} or {foreach}

Sorry for asking so many questions :red:


how i can use validation_errors() in the controller ? - El Forum - 09-19-2012

[eluser]rogierb[/eluser]
you can use $this->form_validation->error_string(). The validation_errors() functions is just a wrapper.