Welcome Guest, Not a member yet? Register   Sign In
Global form validation callbacks? Staged forms?
#2

[eluser]WanWizard[/eluser]
1. If you need extra validation rules thoughout your application, extend the form validation library with a MY_Form_validation library, and create the methods there. You then no longer need the callback, you can define them like all other rules.
2. Use a session variable to store posted information, and an variable indicating the current form. This also allows previous/next buttons to work.
3. The MVC pattern is actually quite simple. The flow is:
- user requests a page
- controller contains the control flow for the request
- controller calls model methods to do the bulk of the processing and all I/O
- model methods return results to the controller
- controller passes them on the the view
- a view is the output of the request

So, a controller contains methods for the different tasks related to the controller. For example 'users/add', 'users/list', 'users/delete', and so on. Every method contains the control flow to deal with that request, either display an initial page or process form input.
A view contains your HTML for the result of the request. In standard CI, a view is equal to a page. You can load multiple views, which will be output in sequence. You can use a template library to structure your page, with header, sidebar, footer, etc.


Messages In This Thread
Global form validation callbacks? Staged forms? - by El Forum - 09-03-2010, 01:35 PM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 04:23 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 04:51 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 06:35 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 07:22 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 08:21 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 10:25 AM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 12:21 PM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 12:38 PM
Global form validation callbacks? Staged forms? - by El Forum - 09-04-2010, 04:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB