CodeIgniter Forums
Examples of integrating same view + procedure across many pages? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Examples of integrating same view + procedure across many pages? (/showthread.php?tid=27784)



Examples of integrating same view + procedure across many pages? - El Forum - 02-20-2010

[eluser]Ki[/eluser]
Anybody has a good examples of integrating a process + related view across many pages?
For example, if "contact us" form is presented in many pages, I can create a view for that form and just load it in many controllers. But since all processing should be done in controller, I would have to add a checker for $_POST event in every controller where the view exists, to see if the form has been submitted and echo "Thank you".
To avoid duplicating this event checker for $_POST in every controller that loads "contact us" page, I could add this check to the view itself, but then it would go against the design gudelines of the CI framework
Anybody has good implementations of this?


Examples of integrating same view + procedure across many pages? - El Forum - 02-20-2010

[eluser]JoostV[/eluser]
Create a contact model or library and put all the business logic in there, so you can reuse it.