• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing arguments from view

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!

You can pass the data through the url or post them in a form.

Either way will do.

Simple! Thanks for the quick reply Smile

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.