mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-02 17:59:36 +07:00
Removed wrong capitalization and few bugs in Sphinx build
Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
@@ -238,8 +238,8 @@ Then session variables can be accessed like this:
|
||||
|
||||
private ISession $session;
|
||||
|
||||
public function __construct($AppName, IRequest $request, ISession $session) {
|
||||
parent::__construct($AppName, $request);
|
||||
public function __construct($appName, IRequest $request, ISession $session) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->session = $session;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ use the **registerService** method on the container object:
|
||||
*/
|
||||
$container->registerService(AuthorController::class, function(ContainerInterface $c): AuthorController {
|
||||
return new AuthorController(
|
||||
$c->get('AppName'),
|
||||
$c->get('appName'),
|
||||
$c->get(Request::class),
|
||||
$c->get(AuthorService::class)
|
||||
);
|
||||
@@ -139,12 +139,12 @@ The container works in the following way:
|
||||
* The matched route queries **AuthorController** service from the container::
|
||||
|
||||
return new AuthorController(
|
||||
$c->get('AppName'),
|
||||
$c->get('appName'),
|
||||
$c->get(Request::class),
|
||||
$c->get(AuthorService::class)
|
||||
);
|
||||
|
||||
* The **AppName** is queried and returned from the base class
|
||||
* The **appName** is queried and returned from the base class
|
||||
* The **Request** is queried and returned from the server container
|
||||
* **AuthorService** is queried::
|
||||
|
||||
@@ -198,9 +198,9 @@ So basically the following is now possible:
|
||||
public MyTestClass $class;
|
||||
public string $appName;
|
||||
|
||||
public function __construct(MyTestClass $class, string $AppName) {
|
||||
public function __construct(MyTestClass $class, string $appName) {
|
||||
$this->class = $class;
|
||||
$this->appName = $AppName;
|
||||
$this->appName = $appName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ So basically the following is now possible:
|
||||
$class2->appName === 'myname'; // true
|
||||
$class2 === $app->getContainer()->get(MyTestClass2::class); // true
|
||||
|
||||
.. note:: $AppName is resolved because the container registered a parameter under the key 'AppName' which will return the app id. The lookup is case sensitive so while $AppName will work correctly, using $appName as a constructor parameter will fail.
|
||||
.. note:: $appName is resolved because the container registered a parameter under the key 'appName' which will return the app id.
|
||||
|
||||
How does it affect the request lifecycle
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -252,8 +252,8 @@ The only thing that needs to be done to add a route and a controller method is n
|
||||
use OCP\IRequest;
|
||||
|
||||
class PageController {
|
||||
public function __construct($AppName, IRequest $request) {
|
||||
parent::__construct($AppName, $request);
|
||||
public function __construct($appName, IRequest $request) {
|
||||
parent::__construct($appName, $request);
|
||||
}
|
||||
|
||||
public function index() {
|
||||
@@ -314,11 +314,12 @@ Parameters:
|
||||
* **webRoot**: The path to the Nextcloud installation
|
||||
|
||||
Aliases:
|
||||
* **AppName**: resolves to ``AppName`` (deprecated)
|
||||
* **Request**: resolves to ``\OCP\\IRequest``
|
||||
|
||||
* **AppName**: resolves to ``appName`` (deprecated)
|
||||
* **Request**: resolves to ``\OCP\IRequest``
|
||||
* **ServerContainer**: resolves to ``\OCP\IServerContainer``
|
||||
* **UserId**: resolves to ``UserId`` (deprecated)
|
||||
* **WebRoot**: resolves to ``WebRoot`` (deprecated)
|
||||
* **UserId**: resolves to ``userId`` (deprecated)
|
||||
* **WebRoot**: resolves to ``webRoot`` (deprecated)
|
||||
|
||||
Types:
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ The config that allows the app to set global, app and user settings can be injec
|
||||
$container->registerService('AuthorService', function(IServerContainer $c): AuthorService {
|
||||
return new AuthorService(
|
||||
$c->get(IConfig::class),
|
||||
$c->get('AppName')
|
||||
$c->get('appName')
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user