CodeIgniter Forums
Hype form validation question - 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: Hype form validation question (/showthread.php?tid=49029)



Hype form validation question - El Forum - 02-06-2012

[eluser]Marc Arbour[/eluser]
Hi to all.

I need guidance from the community. Maybe it's a language barrier question, maybe I'm just not knowledgeable enough.

I have a complete and running website with CI 2.1 to which I need to add a "help us imprive this page" form.

Is anyone familiar with this type of improvement? Does such a thing exist with CI? If so can you tell me how it is called?

I have tought to add validation code on every controller... But that is a lloonngg job.

I have tried with the help of a function in a helper to no success.

Thanks in advance for any pointer.


Hype form validation question - El Forum - 02-06-2012

[eluser]Iciclefeet[/eluser]
I'm a bit confused as what your asking for. But it kinda sounds like you could use a post_controller hook to add a "help us improve this page" form on every page.


Hype form validation question - El Forum - 02-06-2012

[eluser]Marc Arbour[/eluser]
Hello.

I would like to add a form to every single pages on a running website.

I've just read on post_controller hook. I'm not sure that I understand : I could get some code executed every single time I run a function into a controller?

My case would require post_controller_constructor if I understand correctly to "thank" the visitor for submitting the form and prepare the flash data prior to displaying the webpage.

I'll check on this. Hooks would definately be a first for me.

Thanks

Regards

Marc





Hype form validation question - El Forum - 02-06-2012

[eluser]InsiteFX[/eluser]
MY_Controller



Hype form validation question - El Forum - 02-06-2012

[eluser]meigwilym[/eluser]
Add the form to your template file, have the form POST to a controller/method.

Put the $this->uri->query_string() in a hidden input, and redirect back after the processing.

No worries.

Mei


Hype form validation question - El Forum - 02-06-2012

[eluser]Marc Arbour[/eluser]
Wow!

Read on hooks and on MY_Controller.

Both approaches work just fine for my needs. Thanks to you guys.

I have chosen to go with hook simply because it was suggested first and I had a working test hook before I got suggested the MY_Controller method.

Thank you very much.

Marc.