wubbleyou / yii2-widget-jquery-postcodes
Attaches a jquery.postcodes instance to a form
Installs: 153
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/jquery.postcodes: 3.0.1
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-01-24 20:53:05 UTC
README
Based on jquery.postcodes (imported by bower) allowing us to convert postcodes to address' via https://ideal-postcodes.co.uk
Installation
Either run
php composer.phar require --prefer-dist wubbleyou/yii2-widget-jquery-postcodes "*"
or add
"wubbleyou/yii2-widget-jquery-postcodes": "*"
to the require section of your composer.json
file.
Usage
After installing the extension the following is required.
Add the widget to the page, please see the jQuery Demo for more options.
An API Key is required from https://ideal-postcodes.co.uk
JQueryPostcodesWidget::widget([
'pluginOptions' =>
[
'api_key' => 'key',
'output_fields' => [
'line_1' => '#address_line_1',
'line_2' => '#address_line_2',
'post_town' => '#address_line_town',
'county' => '#address_line_county',
'postcode' => '#address_line_postcode'
],
'input_class' => 'form-control',
'button_class' => 'btn btn-default'
]])