/** * get controller path * * @static * @return string */ public static function controller_path() { $folder = str_replace('-', '_', self::$folder); $control = str_replace('-', '_', self::$control); if (file_exists(APATH . 'controllers/' . $folder . '/' . $control . '_controller' . EXT)) { // app controller return APATH . 'controllers/' . $folder . '/' . $control . '_controller' . EXT; } elseif (file_exists(PATH . 'plugins/' . $control . '/controllers/' . $control . '_controller' . EXT)) { // plugin controller return PATH . 'plugins/' . $control . '/controllers/' . $control . '_controller' . EXT; } else { // x4page generic controller array_unshift(self::$args, self::$method); self::$method = self::$control; return SPATH . 'controllers/X4Page_controller' . EXT; } }