App

class OC\AppFramework\App
Entry point for every request in your app. You can consider this as your
public static void main() method
Handles all the dependency injection, controllers and output flow
Source:lib/private/AppFramework/App.php#51

Properties

Methods

public static OC\AppFramework\App::buildAppNamespace($appId, $topNamespace=OCA\)
Turns an app id into a namespace by either reading the appinfo.xml’s
namespace tag or uppercasing the appid’s first letter
Source:

lib/private/AppFramework/App.php#64

Parameters:
  • $appId (string) the app id
  • $topNamespace (string) the namespace which should be prepended to

the transformed app id, defaults to OCA

Returns:

string the starting namespace for the app

public static OC\AppFramework\App::getAppIdForClass($className, $topNamespace=OCA\)
Source:lib/private/AppFramework/App.php#92
public static OC\AppFramework\App::main($controllerName, $methodName, $container, $urlParams=null)
Shortcut for calling a controller method and printing the result
Source:

lib/private/AppFramework/App.php#116

Parameters:
  • $controllerName (string) the name of the controller under which it is

stored in the DI container * $methodName (string) the method that you want to call * $container (OC\AppFramework\DependencyInjection\DIContainer) an instance of a pimple container. * $urlParams (array) list of URL parameters (optional)

Throws:

\OC\HintException

public static OC\AppFramework\App::part($controllerName, $methodName, $urlParams, $container)
Shortcut for calling a controller method and printing the result.
Similar to App:main except that no headers will be sent.
This should be used for example when registering sections via
\OC\AppFramework\Core\API::registerAdmin()
Source:

lib/private/AppFramework/App.php#224

Parameters:
  • $controllerName (string) the name of the controller under which it is

stored in the DI container * $methodName (string) the method that you want to call * $urlParams (array) an array with variables extracted from the routes * $container (OC\AppFramework\DependencyInjection\DIContainer) an instance of a pimple container.