why in my Model cant use $this->load->view() ?? |
[eluser]yudahebat[/eluser]
why in my Model cant use Code: $this->load->view('signup'); Code: redirect('mrputucar/signup'); is it because I call from controller use Code: this->load->view('model_name',$data)
[eluser]pistolPete[/eluser]
Views are loaded in the controller, that's how MVC is supposed to work. Please read the user guide about MVC: http://ellislab.com/codeigniter/user-gui...w/mvc.html http://ellislab.com/codeigniter/user-gui...pflow.html
[eluser]verynewtothis[/eluser]
Models aren't made to do this... It's the controller's job to move requests among the 3 layers of MVC... If you ask me, I would say even the redirection code shouldn't be written in the models and should be done through controllers..
[eluser]meridimus[/eluser]
The controller is the place that calls database operations from your models and gives parsed data to your views. Basically, what you're doing is cute, but it's wrong.
[eluser]InsiteFX[/eluser]
Hi, In the old day's it was like this: Input Proccessing Output To take this a step forward to MVC: Input Controller Processing Model Output View Hope that helps. Enjoy InsiteFX
[eluser]yudahebat[/eluser]
my problem actually want to set_value on form signup but because I use redirect on model it can display on the redirect page. this is my view(only the form) : Code: $attributes = array('class' => 'cssform', 'id' => 'myform'); this is my controller: Code: function signup() and my model : Code: (validation rules) do you have any idea to set_value if you see my code??
[eluser]InsiteFX[/eluser]
The code in your model should be in your view. Enjoy InsiteFX
|
Welcome Guest, Not a member yet? Register Sign In |