承接 fuzzyma/contao-addresspicker 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fuzzyma/contao-addresspicker

Composer 安装命令:

composer require fuzzyma/contao-addresspicker

包简介

Frontend Text Field with Bootstrap Datepicker for Contao Open Source CMS

README 文档

README

Contao Wrapper for google places autocomplete.

Comes with a widget for Backend and Frontend.

For Backend use specify addresspicker in the dca:

$GLOBALS['TL_DCA']['tl_form_field']['fields']['componentRestrictions'] = array
(
    'label'     => &$GLOBALS['TL_LANG']['tl_form_field']['componentRestrictions'],
    'exclude'   => true,
    'inputType' => 'addresspicker',
    'eval'      => array('category' => '(regions)', 'tl_class'=>'w50'}'),
    'sql'       => "varchar(255) NOT NULL default ''"
);

You can pass the following options to eval:

  • category: one of geocode, address, establishment, (regions), (cities)
  • componentRestrictions: a country code to restrict the picker to that country
  • bounds: latitude and longitude for a rectangel the picker is restricted to: 1.223,12.421;4.23,1.213
  • callback: javascipt function name or function declaration which is called when a place was selected (somefunc or function(picker){ console.log(picker.getPlace()) }
  • fields you want to get filled, when a place is selected. Available fields are:
    • use_route
    • use_street_number
    • use_locality
    • use_administrative_area_level_1
    • use_country
    • use_postal_code
    • use_lat_long
  • a type to every use-field to specify long_name or short_name
    • use_route_type
    • use_street_number_type
    • use_locality_type
    • use_administrative_area_level_1_type
    • use_country_type
    • use_postal_code_type

Make sure you have corresponding fields in your dca. The fieldname has to be [name of the adresspicker]_[name of the field without use]. e.g. componentRestrictions_locality

$GLOBALS['TL_DCA']['tl_form_field']['fields']['componentRestrictions'] = array
(
    'label'     => &$GLOBALS['TL_LANG']['tl_form_field']['componentRestrictions'],
    'exclude'   => true,
    'inputType' => 'addresspicker',
    'eval'      => array(
        'callback'          => 'function(a){console.log(a.getPlace())}',
        'category'          => '(regions)',
        'tl_class'          => 'w50',
        'use_locality'      => true,
        'use_locality_type' => 'long_name'
    ),
    'sql'                   => "varchar(255) NOT NULL default ''"
);

// this field is filled automatically when a place is selected
$GLOBALS['TL_DCA']['tl_form_field']['fields']['componentRestrictions_locality`'] = array(
    inputType => 'text'
)

统计信息

  • 总下载量: 110
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2016-01-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固