Welcome Guest, Not a member yet? Register   Sign In
Passing arguments from view
#1

[eluser]donaldpcook[/eluser]
Hi all,

I'm new to CI and MVC in general, and I have a simple question.

How would I pass an argument from the view to the controller (which I would then use in the model)? For example, I am trying to use a function in my model to query the database. I only want it to pull certain data (by using the argument in the WHERE of the active record in my model function) determined by what I request in my view, instead of running a foreach through all of the records in the database.

Is there a proper MVC way of doing this?

Thanks a lot!
#2

[eluser]rogierb[/eluser]
You can pass the data through the url or post them in a form.

Either way will do.
#3

[eluser]donaldpcook[/eluser]
Simple! Thanks for the quick reply Smile




Theme © iAndrew 2016 - Forum software by © MyBB