PHP code example of zitec / form-autocomplete-bundle

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

    

zitec / form-autocomplete-bundle example snippets


        public function getCityWithNameLike($cityName)
            {
                $queryBuilder = $this->createQueryBuilder('c')
                        ->where('c.name like :name or c.internationalName like :name')
                        ->orderBy('c.name', 'ASC')
                        ->setParameter('name', '%'.$cityName.'%');
                //fetch matching cities
                $cities = $queryBuilder->getQuery()->getResult();
                return $cities;
            }
    

        ->add('city', 'zitec_autocomplete', array(
            'data_resolver' => 'cities_with_campaigns_single',
            'placeholder' => 'placeholder_campaign_list_city',
            '