PHP code example of kematjaya / base-controller-bundle

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

    

kematjaya / base-controller-bundle example snippets


// src/Filter/FooFilterType.php
...
use Symfony\Component\Form\FormBuilderInterface;
use Kematjaya\BaseControllerBundle\Filter\AbstractFilterType;
...

class FooFilterType extends AbstractFilterType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('roles', Filters\ChoiceFilterType::class, [
                'choices' => [],
                // query json use JSONQuery(), 
                // date range filter use dateRangeQuery(),
                // float / integer range use floatRangeQuery()
                'apply_filter' => $this->JSONQuery(),
                // 
            ]);
    }
}