PHP code example of kikwik / admink-bundle

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

    

kikwik / admink-bundle example snippets


namespace App\Controller\Admin;

use App\Entity\Famiglia;
use App\Form\FamigliaFormType;
use Kikwik\AdminkBundle\Controller\AbstractCRUDController;
use Symfony\Component\Routing\Attribute\Route;

#[Route('/admin/{_locale}/famiglia', name: 'app_admin_famiglia')]
class FamigliaController extends AbstractCRUDController
{
    protected function getEntityClass(): string
    {
        return Famiglia::class;
    }

    protected function getListFields(): array
    {
        return [
            'nome'=> 'Nome',
            'tipo' => 'Tipo',
            'descrizione' => 'Descrizione',
            'numProdotti' => '# codici',
        ];
    }
    
    protected function getFormClass(): ?string
    {
        return FamigliaFormType::class;
    }
}