PHP code example of tmcycyit / geo-bridge-bundle

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

    

tmcycyit / geo-bridge-bundle example snippets

 php

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Yit\GeoBridgeBundle\YitGeoBridgeBundle(),
    );
}
 php
$this->createFormBuilder()
             ...
             ->add('address', 'geo_address', array('attr' => array('data_id' => 1)))
             ...
 php
namespace Project\MyBundle\Admin;

    protected function configureFormFields(FormMapper $formMapper){

            $container = $this->configurationPool->getContainer();
            $transformer = $container->get('yit_geo_address_trasnformer');

            $formMapper
                ->add(
                    $formMapper->create('address', 'geo_address',  array(
                        'attr' => array(
                            'data_id'       => 1,
                            'placeholder'   => 'text for input',
                            'allow_new'     => true,
                            'button_name'   => 'buttonName',
                            'button_class'  => 'buttonClass',
                            'input_class'   => 'inputClass'
                        )))
                        ->addModelTransformer($transformer))
    }

    public function getFormTheme(){

            return array_merge(
                parent::getFormTheme(),
                array('YitGeoBridgeBundle:Admin:geo_admin.html.twig' )
            );
    }