PHP code example of zicht / admin-bundle

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

    

zicht / admin-bundle example snippets


namespace App\Admin;

use App\Entity\Page\BiographyPage;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Form\FormMapper;
use Zicht\Bundle\AdminBundle\Form\AutocompleteType;

class FooAdmin extends AbstractAdmin
{
    protected function configureFormFields(FormMapper $form): void
    {
        $form
            ->add('somePropertyNameHere', AutocompleteType::class, [
                'repo' => BiographyPage::class,
            ]);
    }
}

    protected function configureRoutes(RouteCollectionInterface $collection): void
    {
        $collection->add('duplicate');
    }