PHPackages                             drmonkeyninja/cakephp-address - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. drmonkeyninja/cakephp-address

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

drmonkeyninja/cakephp-address
=============================

CakePHP helper for formatting addresses

2.1.0(8y ago)15.8k1[1 issues](https://github.com/drmonkeyninja/cakephp-address/issues)MITPHPPHP &gt;=5.3.0

Since Sep 21Pushed 8y ago2 watchersCompare

[ Source](https://github.com/drmonkeyninja/cakephp-address)[ Packagist](https://packagist.org/packages/drmonkeyninja/cakephp-address)[ Docs](https://github.com/drmonkeyninja/cakephp-address)[ RSS](/packages/drmonkeyninja-cakephp-address/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (7)Used By (0)

CakePHP Address
===============

[](#cakephp-address)

[![License](https://camo.githubusercontent.com/aa4615226feb887a2c72699df28befa282c3850fc13d46b7fa67764efdd3a8b0/68747470733a2f2f706f7365722e707567782e6f72672f64726d6f6e6b65796e696e6a612f63616b657068702d616464726573732f6c6963656e73652e706e67)](https://packagist.org/packages/drmonkeyninja/cakephp-address) [![Build Status](https://camo.githubusercontent.com/cc9a0e2d339436d3d0feebfd6401f1cece024358e4487e84e70b95a993532efa/68747470733a2f2f7472617669732d63692e6f72672f64726d6f6e6b65796e696e6a612f63616b657068702d616464726573732e737667)](https://travis-ci.org/drmonkeyninja/cakephp-address)

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

Installation
------------

[](#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
-----

[](#usage)

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

[](#addresshelperformatarray-address-array-fieldsnull-array-optionsarray)

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:-

```
Winter Gardens90 Surrey StreetSheffieldSouth YorkshireS1 2LH

```

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:-

```
90 Surrey StreetSheffieldS1 2LH

```

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:-

```
90 Surrey StreetSheffieldS1 2LH

```

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:-

```
Winter Gardens90 Surrey StreetSheffieldS1 2LHUnited Kingdom

```

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:-

```
Winter Gardens, 90 Surrey Street, Sheffield, S1 2LH, United Kingdom

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~296 days

Total

5

Last Release

3064d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f481390bacd8d21d0caec9b0516971dad97f9f50fa8c8010460860ff76f6e8d?d=identicon)[drmonkeyninja](/maintainers/drmonkeyninja)

---

Top Contributors

[![drmonkeyninja](https://avatars.githubusercontent.com/u/357623?v=4)](https://github.com/drmonkeyninja "drmonkeyninja (23 commits)")

---

Tags

helpercakephp

### Embed Badge

![Health badge](/badges/drmonkeyninja-cakephp-address/health.svg)

```
[![Health](https://phpackages.com/badges/drmonkeyninja-cakephp-address/health.svg)](https://phpackages.com/packages/drmonkeyninja-cakephp-address)
```

###  Alternatives

[drmonkeyninja/cakephp-social-share

CakePHP helper for creating social share/bookmark links

34103.3k](/packages/drmonkeyninja-cakephp-social-share)[dereuromark/cakephp-url-cache

CakePHP plugin to speed up URL reverse lookup

24117.2k](/packages/dereuromark-cakephp-url-cache)[torifat/cake-menu_builder

A dynamic menu building helper for CakePHP 2.x

755.6k](/packages/torifat-cake-menu-builder)[codaxis/cakephp-bootstrap3-helpers

CakePHP highly configurable helpers for Bootstrap 3 framework.

4111.5k2](/packages/codaxis-cakephp-bootstrap3-helpers)[dereuromark/cakephp-calendar

A CakePHP plugin to easily create calendars.

1646.8k1](/packages/dereuromark-cakephp-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
