![]() |
why in my Model cant use $this->load->view() ?? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: why in my Model cant use $this->load->view() ?? (/showthread.php?tid=21601) |
why in my Model cant use $this->load->view() ?? - El Forum - 08-15-2009 [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) why in my Model cant use $this->load->view() ?? - El Forum - 08-15-2009 [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-guide/overview/mvc.html http://ellislab.com/codeigniter/user-guide/overview/appflow.html why in my Model cant use $this->load->view() ?? - El Forum - 08-15-2009 [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.. why in my Model cant use $this->load->view() ?? - El Forum - 08-15-2009 [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. why in my Model cant use $this->load->view() ?? - El Forum - 08-15-2009 [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 why in my Model cant use $this->load->view() ?? - El Forum - 08-16-2009 [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?? why in my Model cant use $this->load->view() ?? - El Forum - 08-16-2009 [eluser]InsiteFX[/eluser] The code in your model should be in your view. Enjoy InsiteFX why in my Model cant use $this->load->view() ?? - El Forum - 08-16-2009 [eluser]yudahebat[/eluser] ohhh... yeah thats work. thnks friend... why in my Model cant use $this->load->view() ?? - El Forum - 08-16-2009 [eluser]InsiteFX[/eluser] Anytime Enjoy InsiteFX |