Welcome Guest, Not a member yet? Register   Sign In
Problems with loading a set of views twice
#5

(02-04-2018, 10:52 AM)Wouter60 Wrote: I don't fully understand the flow of your application, but I suggest to redirect to another url after a succesful login.
Otherwise, the url will remain user/login, and I wonder if that's what you want.
In general, on succesful login, a user is redirected to the home page, or some other page that tells the user he is logged in now.

Also consider using some kind of rendering function in a MY_Controller class.
Example:

PHP Code:
protected function render_page($view,$data=array())
{
    
$this->load->view('theme/header');
    
$this->load->view($view,$data);
    
$this->load->view('theme/footer');        


Now, in your controller, you just need this code to load a specific view:
PHP Code:
$this->render_page('login'); 

This will load the header view, then the login view, and finally the footer view.

My code is only an example how I understand CodeIgniter. I attached a graphic, which shows my idea how the MVC of CodeIgniter works. Hope you understand my intensions. When I am wrong, please tell me

Attached Files
.pdf   Sample_Workflow.pdf (Size: 37.2 KB / Downloads: 24)
Reply


Messages In This Thread
RE: Problems with loading a set of views twice - by sSoftsolution - 02-05-2018, 12:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB