本文整理匯總了PHP中OCP\AppFramework\App::buildAppNamespace方法的典型用法代碼示例。如果您正苦於以下問題:PHP App::buildAppNamespace方法的具體用法?PHP App::buildAppNamespace怎麽用?PHP App::buildAppNamespace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OCP\AppFramework\App
的用法示例。
在下文中一共展示了App::buildAppNamespace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setupRoutes
/**
* If a routes.php file returns an array, try to set up the application and
* register the routes for the app. The application class will be chosen by
* camelcasing the appname, e.g.: my_app will be turned into
* \OCA\MyApp\AppInfo\Application. If that class does not exist, a default
* App will be intialized. This makes it optional to ship an
* appinfo/application.php by using the built in query resolver
*
* @param array $routes the application routes
* @param string $appName the name of the app.
*/
private function setupRoutes($routes, $appName)
{
if (is_array($routes)) {
$appNameSpace = App::buildAppNamespace($appName);
$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
if (class_exists($applicationClassName)) {
$application = new $applicationClassName();
} else {
$application = new App($appName);
}
$application->registerRoutes($this, $routes);
}
}