alkurn/yii2-google

Easy google places extension for Yii2

Installs: 723

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Type:yii2-extension

dev-master 2019-07-30 08:17 UTC

This package is not auto-updated.

Last update: 2024-03-21 05:27:59 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());