Download the PHP package drmonkeyninja/cakephp-address without Composer

On this page you can find all versions of the php package drmonkeyninja/cakephp-address. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cakephp-address

CakePHP Address

License Build Status

This plugin provides a CakePHP 2 View helper for formatting addresses.

Installation

This plugin can be installed using Composer:-

composer require drmonkeyninja/cakephp-address

Alternatively copy the plugin to your app/Plugin directory and rename the plugin's directory 'Address'.

Then add the following line to your bootstrap.php to load the plugin.

CakePlugin::load('Address');

Usage

AddressHelper::format(array $address, array $fields=null, array $options=array())

Returns a formatted address with line breaks:-

$data['CustomerAddress'] = array(
        'house_name' => 'Winter Gardens',
        'house_number' => '90',
        'address_line_1' => 'Surrey Street',
        'city' => 'Sheffield',
        'county' => 'South Yorkshire',
        'postcode' => 'S1 2LH'
    );
echo $this->Address->format($data['CustomerAddress']);

Output:-

<address>Winter Gardens<br />90 Surrey Street<br />Sheffield<br />South Yorkshire<br />S1 2LH</address>

You can define the field names to be used for the address by passing an array of field names as the second parameter:-

$fields =array(
    'address_line_1',
    'city',
    'postcode'
);
echo $this->Address->format($data['CustomerAddress'], $fields);

Output:-

<address>90 Surrey Street<br />Sheffield<br />S1 2LH</address>

You can change the wraptag using the tag option in the third parameter and set other attributes like class:-

echo $this->Address->format($data['CustomerAddress'], $fields, array('tag' => 'div', 'class' => 'address'));

Output:-

<div class="address">90 Surrey Street<br />Sheffield<br />S1 2LH</div>

The field names support the Hash direct path syntax so that you can use slightly more complex address arrays with the formatter. For example, we can handle an associated Country model like this:-

$data['CustomerAddress'] = array(
    'house_name' => 'Winter Gardens',
    'address_line_1' => '90 Surrey Street',
    'city' => 'Sheffield',
    'postcode' => 'S1 2LH',
    'Country' => array(
        'name' => 'United Kingdom'
    )
);
$fields = array(
    'house_name',
    'address_line_1',
    'city',
    'postcode',
    'Country.name'
);
echo $this->Address->format($data['CustomerAddress'], $fields);

Output:-

<address>Winter Gardens<br />90 Surrey Street<br />Sheffield<br />S1 2LH<br />United Kingdom</address>

You can change the output markup by passing values for tag and separator:-

echo $this->Address->format($data['CustomerAddress'], $fields, array('tag' => 'p', 'separator' => ', '));

Output:-

<p>Winter Gardens, 90 Surrey Street, Sheffield, S1 2LH, United Kingdom</p>

All versions of cakephp-address with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package drmonkeyninja/cakephp-address contains the following files

Loading the files please wait ...