function getContent($params, $dynamic) { $content = ''; $controller = $params['controller']; $action = $params['action']; unset($params['controller'], $params['action']); include_once 'controller/inflector.php'; $method = Inflector::camelize($action); if ($ctrl =& NController::factory($controller)) { if ($dynamic) { $content = $this->dynamicPHP($ctrl, $method, NController::getIncludePath($controller), $params); } else { $content = $ctrl->{$method}($params); } unset($ctrl); } return $content; }
/** * Checks to see if a controller exists * * @param string $controller - should be an underscored word * @return string */ static function exists($controller) { if (!$controller) { return false; } $path = NController::getIncludePath($controller); if (!$path) { return false; } include_once $path; $class = NController::getClassName($controller); return class_exists($class); }