looptribe / form-spatial
该包已被放弃且不再维护。没有建议的替代包。
为Symfony2表单提供Google Maps的空间支持
v0.0.3
2018-04-19 14:36 UTC
Requires
- creof/doctrine2-spatial: ^1.1
- symfony/form: >=2.8
- twig/twig: ^1.12||^2.0
This package is not auto-updated.
Last update: 2023-09-30 12:41:44 UTC
README
为使用Google Maps的Symfony2表单提供空间支持。
该包是creof/doctrine2-spatial的Symfony2表单集成。它添加了一个新的表单类型point
,用于通过Google Maps编辑空间Point
类型。
安装
$ php composer.phar require looptribe/form-spatial dev-master
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Looptribe\FormSpatialBundle\LooptribeFormSpatialBundle(), // ... ); }
# app/config/parameters.yml parameters: looptribe.formspatial.google_maps_api_key: YOUR_API_KEY
使用
当您创建表单时,将Point字段类型设置为Looptribe\FormSpatialBundle\Form\Type\PointType
<?php public function buildForm(FormBuilderInterface $builder, array $options) { $builder // ... ->add('location', Looptribe\FormSpatialBundle\Form\Type\PointType::class) // ... ; }
开发
目前仅支持地理Point
类型。