PHP code example of mssalvo / banquet

1. Go to this page and download the library: Download mssalvo/banquet 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/ */

    

mssalvo / banquet example snippets


use Banquet\Ms\Core\Attribute\Route;

class Corsi extends SenderAction {
    #[Route('/corsi', 'GET')]
    public function send() {
        // ...
    }
}

class CorsiRest extends SenderAction {
    #[Route('/api/corsi', 'GET')]
    public function getAll(): void { }

    #[Route('/api/corsi/{id}', 'GET')]
    public function getById($id = null): void { }

    #[Route('/api/corsi', 'POST')]
    public function getInsert(): void { }

    #[Route('/api/corsi/{id}', 'DELETE')]
    public function getDelete($id = null): void { }
}

class Articoli extends SenderAction {
    public function __construct(
        ArticoliService $service,    // Risolto automaticamente
        Logger $log
    ) { }
}

public function send() {
    $this->setTemplateName("pages/home");
    $this->setTemplateChildren([
        \Banquet\Actions\Header\Header::class,
        \Banquet\Actions\Menu\Menu::class,
        \Banquet\Actions\Footer\Footer::class
    ]);
    return $this->getTemplate("default");
}
html
<body>
    <?= $Header ?? ''