PHP code example of ds-easy / typo3-routes

1. Go to this page and download the library: Download ds-easy/typo3-routes library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ds-easy / typo3-routes example snippets




namespace Vendor\Extension\Controller;

use Ds\Easy\Attribute\Route;
use Ds\Easy\Controller\EasyController;
use Psr\Http\Message\ResponseInterface;

class DemoController extends EasyController
{

}


#[Route('/path/to/your/page', format: 'html')]
public function showPage(): ?ResponseInterface
{
    return $this->render('EXT:extension/Resources/Private/PageView/Pages/EasyDemos/Demo.html', partialRootPaths: ['EXT:extension/Resources/Private/PageView/Partials']);
}



namespace Vendor\Extension\Controller;

use Ds\Easy\Attribute\Route;
use Ds\Easy\Controller\EasyController;
use Psr\Http\Message\ResponseInterface;

class DemoController extends EasyController
{

    #[Route('/path/to/your/page', format: 'html')]
    public function showPage(): ?ResponseInterface
    {
        return $this->render('EXT:extension/Resources/Private/PageView/Pages/EasyDemos/Demo.html', partialRootPaths: ['EXT:extension/Resources/Private/PageView/Partials']);
    }
}