page = $GLOBALS['page']; } // -------------------------------------------------------------------------- /** * Function for loading a model into the current class * * @param string $file * @param array $args * @return void */ public function load_model($file, $args=array()) { $segments = explode('\\', $file); $file_name = end($segments); // The module is set via the router $module = strtolower(MM_MOD); $path = MM_MOD_PATH . "{$module}/models/{$file_name}.php"; if (is_file($path)) { require_once($path); } if ( ! empty($args)) { $this->$file_name = new $file($args); } else { $this->$file_name = new $file; } } // -------------------------------------------------------------------------- /** * Function for loading a view * * @param string $file * @param array $data * @param bool $return * @return mixed */ public function load_view($file, array $data=array(), $return=FALSE) { return $this->page->load_view($file, $data, $return); } } // End of controller.php