petrabarus / yii2-googleplacesautocomplete
Google Places Auto Complete input widget for Yii2
Installs: 6 365
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 3
Forks: 11
Open Issues: 4
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-10-22 16:12:15 UTC
README
Google Places Auto Complete widget for Yii2
##Installation
Add below to your composer.json
file
"repositories": [
{
"type": "vcs",
"url": "https://github.com/petrabarus/yii2-googleplacesautocomplete"
}
],
"requires": {
"petrabarus/yii2-googleplacesautocomplete": "*"
}
##Usage
Using widget and model.
use PetraBarus\Yii2\GooglePlacesAutoComplete\GooglePlacesAutoComplete;
echo GooglePlacesAutoComplete::widget([
'model' => $model,
'attribute' => 'location'
]);
Using widget for custom field name and value.
use PetraBarus\Yii2\GooglePlacesAutoComplete\GooglePlacesAutoComplete;
echo GooglePlacesAutoComplete::widget([
'name' => 'place'
'value' => 'Jakarta'
]);
Using active form.
use yii\bootstrap\ActiveForm;
use PetraBarus\Yii2\GooglePlacesAutoComplete\GooglePlacesAutoComplete;
echo $form = ActiveForm::begin();
echo $form->field($model, 'location')->widget(GooglePlacesAutoComplete::className());