Welcome Guest, Not a member yet? Register   Sign In
mvc all in one file
#7

[eluser]beemr[/eluser]
I've been able to treat my login component library as if it were a view. The multiple views addition in 1.6 made it possible for me to pass membership requirements in to the library function and have it return either the appropriate view for the user's state or reject them. Just make sure that your main library function returns $this->CI->load->view('loginview.php',$data) when it resolves to true. Upon a false, you can call a rejection routine. This way each controller's view setup might look like this:
Code:
$this->load->view->header.php;
$this->MY_library->login_component($this->MY_library->check('designer'));
$this->load->view->footer.php
In this way, MY_library->check() will return true if the current user is at least a 'designer,' and upon true, MY_library->login_component will build the appropriate view call.


Messages In This Thread
mvc all in one file - by El Forum - 03-24-2008, 12:50 PM
mvc all in one file - by El Forum - 03-24-2008, 01:43 PM
mvc all in one file - by El Forum - 03-24-2008, 01:50 PM
mvc all in one file - by El Forum - 03-24-2008, 01:59 PM
mvc all in one file - by El Forum - 03-24-2008, 02:14 PM
mvc all in one file - by El Forum - 03-24-2008, 02:15 PM
mvc all in one file - by El Forum - 03-24-2008, 04:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB