2017 © Pedro Peláez
 

yii2-extension cm-address

Common Address Module for yii2

image

frenzelgmbh/cm-address

Common Address Module for yii2

  • Tuesday, January 9, 2018
  • by philippfrenzel
  • Repository
  • 2 Watchers
  • 0 Stars
  • 519 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

cm-address

common module :: Address Management Module (Frenzel GmbH 2017) v.1.0.4, (*1)

Allows you to add addresses to a model by your choice. You can define wheater it's a main address or not., (*2)

@author philipp@frenzel.net Philipp Frenzel, (*3)

Installation

Add the following line to your composer.json require section:, (*4)

"frenzelgmbh/cm-address":"*",
php yii migrate --migrationPath=@vendor/frenzelgmbh/cm-address/migrations

Inside your yii-config, pls. add the following lines to your modules section. As you might see, the gridview needs to be implemented too., (*5)

'address'=>[
  'class' => 'net\frenzel\address\Module',
  'userIdentityClass' => 'app\models\User', //points to your user identity class
],

Design

The Address module is use to store address/location informations, that can be linked to any other "module". So in general all modules are referenced by:, (*6)

  • entity (which should hold the table name VARCHAR(100))
  • entity_id (which should hold the primarey key of the referenced record INTEGER(11))

Works by passing over the model to the widget!, (*7)

Geolocation

The module tries to enrich each passed over address with the latitude and longitude, which will be looked up by combining street, address and state information., (*8)

Widgets

Address Management Widget:, (*9)

<?= \net\frenzel\address\views\widgets\Addresses::widget(['model'=> $model]) ?>

Renders a Map with all related address points related to the model:, (*10)

<?= \net\frenzel\address\views\widgets\MapWidget::widget(['model'=> $model]) ?>

The Versions