本文整理汇总了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);
}
}