2017 © Pedro Peláez
 

symfony-bundle postcodenl-api-bundle

http://api.postcode.nl integration in Symfony2.

image

keesschepers/postcodenl-api-bundle

http://api.postcode.nl integration in Symfony2.

  • Sunday, February 28, 2016
  • by keesschepers
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,141 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

PostcodeNL Api Bundle

This bundle helps you integrating the Postcode.nl API into your Symfony project. With this integrated you can autocomplete street and places automaticly based on the user supploed postalcode and house number., (*1)

Installation

Add this bundle to your composer.json:, (*2)

{
    "require": {
        "keesschepers/postcodenl-api-bundle": "dev-master"
    }
}

Second, add the bundle to your AppKernel.php:, (*3)

public function registerBundles()
{
    $bundles = array(
        // ...
        new Keesschepers\PostcodenlApiBundle\KeesschepersPostcodenlApiBundle(),
    );
}

Third, you need to configure the bundle by adding the following to your config.yml:, (*4)

keesschepers_postcodenl_api:
    base_url: "https://api.postcode.nl/rest/addresses"
    timeout: 5
    api_user: %keesschepers_postcodenl_api.api_user%
    api_secret: %keesschepers_postcodenl_api.api_secret%

Where you can supply api_user and api_secret directly or like the example above in your parameters.yml (recommended)., (*5)

And optionally import the routing.yml into your project:, (*6)

keesschepers_postcodenl_api:
    resource: "@KeesschepersPostcodenlApiBundle/Resources/config/routing.yml"
    prefix:   /

If you followed these steps correctly you should have access to the followin url:, (*7)

http://your.project.local/app_dev.php/get-postalcode-details?zipcode=0000XX&address-number=XX

Advance usage

You can also use the service in your own controller:, (*8)

$api = $this->get('keesschepers_postcodenl_api.api');
$response = $api->getResponseByPostcodeAndHousenumber($postalcode, $housenr);

The Versions

28/02 2016

dev-master

9999999-dev

http://api.postcode.nl integration in Symfony2.

  Sources   Download

MIT

The Requires

 

rest symfony postcode postalcode