retro/lib/Controller/PageController.php
Michel Roux dc16fc8c49
Some checks failed
retro / xml (push) Successful in 22s
retro / php (push) Failing after 34s
retro / nodejs (push) Failing after 1m0s
retro / release (push) Has been skipped
feat: remove vue and work on init
2025-01-02 08:10:20 +01:00

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',
);
}
}