libraries/MVC/BController.php
public function LoadModel($mdlname=''){
		if(empty($mdlname)){
			bimport('mvc.model');
			return new BModel();
			}
		$fn=BCOMPONENTSAPPLICATIONPATH.$this->componentname.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.$mdlname.'.php';
		if(!file_exists($fn)){
			$fn=BCOMPONENTSFRAMEWORKPATH.$this->componentname.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.$mdlname.'.php';
			}
		$class='Model_'.$this->componentname.'_'.$mdlname;
		if(!file_exists($fn)){
			echo('File "'.$fn.'" does not exist!');
			return NULL;
			}
		require_once($fn);
		$model=new $class;
		$model->controller=$this;
		return $model;
		}
public function LoadModel($mdlname=''){
		if(empty($mdlname)){
			bimport('mvc.model');
			return new BModel();
			}
		$fn=BCOMPONENTSAPPLICATIONPATH.$this->componentname.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.$mdlname.'.php';
		if(!file_exists($fn)){
			$fn=BCOMPONENTSFRAMEWORKPATH.$this->componentname.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.$mdlname.'.php';
			}
		$class='Model_'.$this->componentname.'_'.$mdlname;
		if(!file_exists($fn)){
			echo('File "'.$fn.'" does not exist!');
			return NULL;
			}
		require_once($fn);
		$model=new $class;
		$model->controller=$this;
		return $model;
		}
public function LoadModel ( $ mdlname = '' ) { if ( empty ( $ mdlname ) ) { bimport ( 'mvc.model' ) ; return new BModel ( ) ; } $ fn = BCOMPONENTSAPPLICATIONPATH . $ this -> componentname . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR . $ mdlname . '.php' ; if ( ! file_exists ( $ fn ) ) { $ fn = BCOMPONENTSFRAMEWORKPATH . $ this -> componentname . DIRECTORY_SEPARATOR . 'models' . DIRECTORY_SEPARATOR . $ mdlname . '.php' ; } $ class = 'Model_' . $ this -> componentname . '_' . $ mdlname ; if ( ! file_exists ( $ fn ) ) { echo ( 'File "' . $ fn . '" does not exist!' ) ; return NULL ; } require_once ( $ fn ) ; $ model = new $ class ; $ model -> controller = $ this ; return $ model ; }
Load the model of current component by alias

@param type $mdlname
@return null|\BModel
Load the model of current component by alias