• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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?

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? :-)

it too))

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.


[eluser]Martin Hedegaard[/eluser]
thank :-)

[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).

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:
<div>&lt;? $date = date('d.m.y',time());?&gt;</div>

and he wants to get the $date in the controller

[eluser]TWP Marketing[/eluser]
Will you be more specific. What do you want to do and why?
We are trying to guess at your meaning and telepathy is notoriously unreliable...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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