Welcome Guest, Not a member yet? Register   Sign In
How does a form validation know about the form?
#1

I might have missed something fundamental here!

I was looking at the CI tutorial for form validation (https://www.codeigniter.com/userguide3/l...n-tutorial) and I can't work out how the rules know about the form. As far as I can see, the basic workflow is:

 - from a URL, the controller is loaded
 - once the form helper has been loaded, the set_rules() function can be called as many times as desired
 - the run() function can be called
 - the return value of run() can be used to determine what view is loaded

The final step is the first time that the controller knows anything about the view, so how can the run() function (when it is called) know what view it needs to be acting upon? Does CI load the whole function, then find the form in the view that is associated with control structure of the run() function?
Reply


Messages In This Thread
How does a form validation know about the form? - by ccw - 06-12-2017, 10:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB