alkurn/yii2-google

Easy google places extension for Yii2

Installs: 271

Dependents: 0

Suggesters: 0

Stars: 1

Watchers: 1

Forks: 0

Type:yii2-extension

dev-master 2018-11-28 15:42 UTC

README

Google Places Auto Complete widget for Yii2

##Installation

Add below to your composer.json file

    "requires": {
        "alkurn/yii2-google": "dev-master"
    }
composer require alkurn/yii2-google

##Usage

Using widget and model. Using widget for custom field name and value.

use alkurn\google\Places;
use alkurn\google\Map;
echo Places::widget([
    'name' => 'place'
    'value' => 'Jakarta'
]);

use alkurn\google\Map;
echo Map::widget([
    'latitude' => '34.000',
    'longitude' => '84.000',
    'title' => 'India'
]);

Using active form.

use yii\bootstrap\ActiveForm;
use alkurn\google\Places;

echo $form = ActiveForm::begin();
echo $form->field($model, 'location')->widget(Places::className());