40 lines
1000 B
PHP
40 lines
1000 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\Retro\Controller;
|
|
|
|
use OCA\Retro\AppInfo\Application;
|
|
use OCP\AppFramework\Controller;
|
|
use OCP\AppFramework\Http\Attribute\FrontpageRoute;
|
|
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
|
|
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
|
use OCP\AppFramework\Http\TemplateResponse;
|
|
use OCP\AppFramework\Services\IInitialState;
|
|
use OCP\IRequest;
|
|
use OCP\Util;
|
|
|
|
class PageController extends Controller
|
|
{
|
|
public function __construct(IRequest $request, private IInitialState $initialState)
|
|
{
|
|
parent::__construct(Application::APP_ID, $request);
|
|
}
|
|
|
|
#[NoCSRFRequired]
|
|
#[NoAdminRequired]
|
|
#[FrontpageRoute(verb: 'GET', url: '/{path}')]
|
|
public function index(): TemplateResponse
|
|
{
|
|
Util::addStyle(Application::APP_ID, Application::APP_ID . '-main');
|
|
Util::addScript(Application::APP_ID, Application::APP_ID . '-main');
|
|
|
|
$this->initialState->provideInitialState();
|
|
|
|
return new TemplateResponse(
|
|
Application::APP_ID,
|
|
'index',
|
|
);
|
|
}
|
|
}
|