1. Go to this page and download the library: Download germania-kg/addresses 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/ */
germania-kg / addresses example snippets
use Germania\Address;
$address = new Address;
// All these are string or null
echo $address->getStreet1();
echo $address->getStreet2();
echo $address->getZip();
echo $address->getLocation();
echo $address->getCountry();
echo $address->getType();
// Depending on street1/street2, zip, and location
echo $address->isEmpty() ? "empty" : "has address data";
// Setters accept string or null,
// returning fluent interface.
$address->setStreet1( $new_street_1 )
->setStreet2( $new_street_2 )
->setZip( $new_zip )
->setLocation( $new_location )
->setsetCountry( $new_country )
->setType( $new_type );
use Germania\AddressProviderInterface;
use Germania\AddressProviderTrait;
class MyClass implements AddressProviderInterface
{
use AddressProviderTrait;
}
$obj = new MyClass;
$address = $obj->getAddress();
use Germania\Address;
use Germania\AddressAwareInterface;
use Germania\AddressAwareTrait;
class MyClass implements AddressProviderInterface
{
use AddressAwareTrait;
}
$obj = new MyClass;
$address = $obj->getAddress();
// null
$obj->setAddress( new Address );
print_r( $obj->getAddress() );
// Germania\Address
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.