mirror of
https://github.com/nextcloud/documentation.git
synced 2026-03-27 13:38:39 +07:00
Moving section Redirects
Signed-off-by: Christian Wolf <github@christianwolf.email>
This commit is contained in:
@@ -641,6 +641,24 @@ Miscellaneous responses
|
||||
Redirects
|
||||
^^^^^^^^^
|
||||
|
||||
A redirect can be achieved by returning a RedirectResponse:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
namespace OCA\MyApp\Controller;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\RedirectResponse;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
public function toGoogle(): RedirectResponse {
|
||||
return new RedirectResponse('https://google.com');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Downloads
|
||||
^^^^^^^^^
|
||||
|
||||
@@ -777,27 +795,6 @@ The following policy for instance allows images, audio and videos from other dom
|
||||
|
||||
---
|
||||
|
||||
Redirects
|
||||
^^^^^^^^^
|
||||
|
||||
A redirect can be achieved by returning a RedirectResponse:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
namespace OCA\MyApp\Controller;
|
||||
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\RedirectResponse;
|
||||
|
||||
class PageController extends Controller {
|
||||
|
||||
public function toGoogle(): RedirectResponse {
|
||||
return new RedirectResponse('https://google.com');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Downloads
|
||||
^^^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user