Now that you want to share the model file, tell the system where to load our file. This work is done in the loader.php class, so you need to modify the default behavior:
/ * * * List of paths to load models from * * @var Array * @access protected */
>
protected
$_ci_model_paths
array();
1 /**2 * Constructor3 *4 * Sets the path to the view files and gets the initial output buffering level5 */6 Public function__construct ()7 {8 $this->_ci_ob_level =Ob_get_level();9 $this->_ci_library_paths =Array(APPPATH,basepath);Ten $this->_ci_helper_paths =Array(APPPATH,basepath); One A //$this->_ci_model_paths = Array (APPPATH); Default path for model - - $this->_ci_model_paths =Array(Fcpath);//Modify the _ci_model_paths to a common/target path! the - $this->_ci_model_paths =Array(APPPATH, Fcpath);//specify that we can get our model files from both the APPPATH and Fcpath directories! - - + $this->_ci_view_paths =Array(APPPATH. ' views/' =TRUE); - +Log_message (' Debug ', "Loader Class Initialized"); A } at - not recommended to directly modify the source code, it is best to extend the CI!. -Create a my_loader in application/core/.PHP -Note, however, that there are two apps in the foreground and backstage, so there is a my_loader in the core directory in two places.PHP Extensions! -<?PHP - defined(' BasePath ') ORExit(' No Direct script Access allowed! '); in - classMy_loaderextendsCi_loader { to Public function__construct () { +Parent::__construct (); - the //specify that we can get our model files from both the APPPATH and Fcpath directories! * $this->_ci_model_paths =Array(APPPATH,Fcpath);
Or:
Array (Common_path);
3 9 }
Similarly, to allow the site to support multiple sets of templates/skins also to extend the class. The corresponding properties are:
/* * * List of paths to load views from * * @var Array * @access protected */
>
protected
$_ci_view_paths
array();
CI Framework two application share the same set of model