passing data to a model |
[eluser]Martin Hedegaard[/eluser]
Is there someone here who knows how I send data / variable to a "model" from a "view" in codeigniter?
[eluser]siptik[/eluser]
Why do you need it? This violates the concept of MVC
[eluser]Martin Hedegaard[/eluser]
[quote author="siptik" date="1347182459"]Why do you need it? This violates the concept of MVC[/quote] Okay... How do i then send it to the controller? :-)
[eluser]sofwan[/eluser]
Although it violates the concept of MVC but you can send data using session. Save your data to session variable from your view and in Model, retrieve it. http://ellislab.com/codeigniter/user-gui...sions.html
[eluser]TWP Marketing[/eluser]
You can also use an HTML form to POST data back to your controller. You may also use parameters in an URL link within your view and read them as URI segments (see the User Guide URI class).
[eluser]siptik[/eluser]
As I understand he meant a little more. he wants to create a variable in the template and send it to the controller or model. for example: template: <div><? $date = date('d.m.y',time());?></div> and he wants to get the $date in the controller
|
Welcome Guest, Not a member yet? Register Sign In |