Nextcloud PHP API (master)

App
in package

Class App

Any application must inherit this call - all controller instances to be used are to be registered using IContainer::registerService

Tags
since
6.0.0

Table of Contents

Properties

$container  : DIContainer

Methods

__construct()  : mixed
buildAppNamespace()  : string
Turns an app id into a namespace by convention. The id is split at the underscores, all parts are CamelCased and reassembled. e.g.: some_app_id -> OCA\SomeAppId
dispatch()  : void
This function is called by the routing component to fire up the frameworks dispatch mechanism.
getContainer()  : ContainerInterface

Properties

$container

private DIContainer $container

Methods

__construct()

public __construct(string $appName[, array<string|int, mixed> $urlParams = [] ]) : mixed
Parameters
$appName : string
$urlParams : array<string|int, mixed> = []

an array with variables extracted from the routes

Tags
since
6.0.0

buildAppNamespace()

Turns an app id into a namespace by convention. The id is split at the underscores, all parts are CamelCased and reassembled. e.g.: some_app_id -> OCA\SomeAppId

public static buildAppNamespace(string $appId[, string $topNamespace = 'OCA\\' ]) : string

use IAppManager::getAppNamespace

Parameters
$appId : string

the app id

$topNamespace : string = 'OCA\\'

the namespace which should be prepended to the transformed app id, defaults to OCA\

Tags
since
8.0.0
Return values
string —

the starting namespace for the app

dispatch()

This function is called by the routing component to fire up the frameworks dispatch mechanism.

public dispatch(string $controllerName, string $methodName) : void
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

Tags
since
6.0.0

getContainer()

public getContainer() : ContainerInterface
Tags
since
6.0.0
35.0.0

Typed as returning a ContainerInterface instead of the deprecated IAppContainer

Return values
ContainerInterface
On this page

Search results