Welcome Guest, Not a member yet? Register   Sign In
Redirect function vs load->view
#1

[eluser]condoace[/eluser]
for some reason I can not load a view within an if condition - so I am trying to use redirect function instead... any help in modifying the code below to work for redirect function


//loading a view by loading a template file and using an array to load content inside the template file

Code:
$this->load->view('include/template', array('main_content' => 'rooms/addroom_view'));


Any ideas how I can achieve this with a redirect function??
#2

[eluser]toopay[/eluser]
There are main difference between redirect and switching the view. View is just a html stucture page with some pseudo variable mark-up to receive the data from controller. If you do a redirect, means the http request will redirected to new location : it will processes once again with all core class, controller, model (if you have ones) then the view. Pick the option, based by your needs! If you just need the html structure changed, pick $this->load->view. If you need to check something before outputing the view, pick redirect.




Theme © iAndrew 2016 - Forum software by © MyBB