2017 © Pedro Peláez
 

symfony-bundle egulias-provinces-bundle

Bundle for provinces

image

egulias/egulias-provinces-bundle

Bundle for provinces

  • Wednesday, June 27, 2012
  • by egulias
  • Repository
  • 0 Watchers
  • 0 Stars
  • 11 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Provinces bundle for Symfony2/Doctrine2

This bundle is intended to allow you to easily have the basic structure of regions-provinces of a given country (or all, I hope)., (*1)

Build
Status, (*2)

Installation and configuration:

Get the bundle

Add to your /deps file :, (*3)

[EguliasProvincesBundle]
    git=http://github.com/egulias/EguliasProvincesBundle.git
    target=/bundles/Egulias/ProvincesBundle
  • Side note: if you want provinces and regions in the database, you will need doctrine-fixtures and DoctrineFixturesBundle, (*4)

    [doctrine-fixtures]   
        git=http://github.com/doctrine/data-fixtures.git
    
    [DoctrineFixturesBundle]
        git=http://github.com/symfony/DoctrineFixturesBundle.git
        target=/bundles/Symfony/Bundle/DoctrineFixturesBundle 
    

And make a php bin/vendors install., (*5)

Register the namespace

``` php <?php, (*6)

// app/autoload.php $loader->registerNamespaces(array( 'Egulias' => DIR.'/../vendor/bundles', // your other namespaces ));, (*7)

  * Installation note for Database fixtures:
    Also add this to registerNamespaces

    ``` 'Doctrine\\Common\\DataFixtures' => __DIR__.'/../vendor/doctrine-fixtures/lib',
        'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib', 
    ```

### Add EguliasProvincesBundle to your application kernel

``` php
<?php

  // app/AppKernel.php
  public function registerBundles()
  {
    return array(
      // ...
      new Egulias\EguliasProvincesBundle\EguliasProvincesBundle(),
      // ...
      );
  }
  • Installation note for Database fixtures: Also add
    new Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),

Usage

  • Without a database Just use the needed localized Entity for regions or provinces (as of this writing, only SpainProvince) and use the provided methods., (*8)

  • With Database Features have been removed, but will be available soon, (*9)

    • First you'll need to do a app/console doctrine:schema:update --force (or --dump-sql first to see the sql to be executed) to generate the db tables.
    • Secondly you'll need to dump data with app/console doctrine:fixtures:load --fixtures=vendor/bundles/Egulias/EguliasProvincesBundle/DataFixtures/ORM/ If you want just to dump specific countries data, just point to the corresponding data fixture (e.g LoadSpanishRegions)

The Versions

27/06 2012

dev-master

9999999-dev http://github.com/egulias/EguliasProvincesBundle.git

Bundle for provinces

  Sources   Download

MIT

The Requires

 

27/06 2012