Welcome Guest, Not a member yet? Register   Sign In
Modular Separation.
#9

[eluser]PhilTem[/eluser]
Aaaah, I finally get it Wink

Then your code should be something like this (haven't tested it, so it may be a little faulty, but should hint you towards the right direction)

Code:
if ( $this->functions_model->null_check($view_file) === TRUE )
{
    $content = $this->load->view('components/body_unknown_view', NULL, TRUE);
}
else
{
    $skip = FALSE;
    
    foreach ( Modules::$locations as $location => $offset )
    {
        if ( ! is_dir($base = $location . $this->router->fetch_module()) )
        {
            continue;
        }
        
        if ( file_exists($base . 'views/' . $view_file) )
        {
            $content = $this->load->view($view_file, NULL, TRUE);
            
            $skip = TRUE;
            
            break;
        }
    }
    
    if ( ! $skip )
    {
        $content = $this->load->view($view_file, NULL, TRUE);
    }
}

echo $content;

There could be some errors with directory-separators, but I don't have a PHP-environment around, so unfortunately, I cannot test it right now Wink


Messages In This Thread
Modular Separation. - by El Forum - 01-26-2013, 04:27 PM
Modular Separation. - by El Forum - 01-27-2013, 05:54 PM
Modular Separation. - by El Forum - 01-28-2013, 01:26 AM
Modular Separation. - by El Forum - 01-28-2013, 02:08 AM
Modular Separation. - by El Forum - 01-28-2013, 05:55 AM
Modular Separation. - by El Forum - 01-28-2013, 03:00 PM
Modular Separation. - by El Forum - 01-29-2013, 12:40 AM
Modular Separation. - by El Forum - 01-29-2013, 12:48 AM
Modular Separation. - by El Forum - 01-29-2013, 12:55 AM
Modular Separation. - by El Forum - 01-29-2013, 01:07 AM
Modular Separation. - by El Forum - 01-29-2013, 01:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB