Welcome Guest, Not a member yet? Register   Sign In
Dynamic Models and Views; Parser
#2

[eluser]popovich[/eluser]
Update

I am now trying to use custom classes instead of models.
Here is how the code looks now.

Main controller
Code:
function init_modules( $modules ) {
    
        $retour = array();
        
        if( count($modules) < 1 ){
        
            return false;
            
        }else{
        
            foreach ( $modules as $mod ) {
                
                $data = array();
                $dynamic_class = 'mc_'.$mod;
                $dynamic_view = 'modules/mv_'.$mod;

                $data = $this->load->library($dynamic_class);
                $retour[]['mod_content'] = $this->load->view($dynamic_view, $data);
                
            }    
                                        
        }

        return $retour;
        
    }

One of the classes, system\application\libraries\mc_press.php

Code:
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Mm_press {
    
     function Mm_press() {
        return array('press'=>"do press");
    }

}

?&gt;

And here is the fatal error (!)
Fatal error: Class 'mc_press' not found in D:\***\system\libraries\Loader.php on line 871

?!


Messages In This Thread
Dynamic Models and Views; Parser - by El Forum - 03-24-2008, 08:29 AM
Dynamic Models and Views; Parser - by El Forum - 03-24-2008, 09:26 AM
Dynamic Models and Views; Parser - by El Forum - 03-24-2008, 10:24 AM
Dynamic Models and Views; Parser - by El Forum - 03-24-2008, 10:42 AM
Dynamic Models and Views; Parser - by El Forum - 03-24-2008, 10:48 AM
Dynamic Models and Views; Parser - by El Forum - 03-24-2008, 11:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB