Welcome Guest, Not a member yet? Register   Sign In
passing value from view to controller to model
#1

[eluser]new kid[/eluser]
i want to pass a single value from view through href to a function in controller and from there to model how ??

please help
#2

[eluser]SpooF[/eluser]
Code:
http://localhost/index.php/controller/method/value
Code:
class controller extends Controller
{
    function controller()
    {
         parent::Controller();
         $this->load->model('model');
    }

    function method($var)
    {
         $this->model->method($var);
    }
}

Not quite sure exactly what your asking.
#3

[eluser]new kid[/eluser]
thanks and how to get this in model
#4

[eluser]new kid[/eluser]
wat i want to do is pass a value through href to a function in controller and pass it to model from there

ineed the value in the model to use in select

from

where'value'


help please
#5

[eluser]SpooF[/eluser]
You can pass variables to the functions in your model the same way you do any other function.
#6

[eluser]Colin Williams[/eluser]
new kid probably doesn't know how functions work.
#7

[eluser]daparky[/eluser]
This should help you: http://ellislab.com/codeigniter/user-gui...uting.html




Theme © iAndrew 2016 - Forum software by © MyBB