Zend Framework 2-Doctrine 2-如何使用GeoPointFields [英] Zend Framework 2 - Doctrine 2 - How to use GeoPointFields
本文介绍了Zend Framework 2-Doctrine 2-如何使用GeoPointFields的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用Doctrine2实现GeoPointField
.
I need to implement a GeoPointField
with Doctrine2.
Zend和Doctrine似乎并不原生支持它...
It seems that Zend and Doctrine don't support it natively...
是否有验证这种输入的最佳实践?在数据库中,我将使用一个简单的字符串字段,对吧?
Is there a best practice for validating such an input? In the database I'd use a simple string field, right?
推荐答案
/^(\-?\d+(?:\.\d+)?),?\s*(\-?\d+(?:\.\d+)?)$/
此正则表达式验证并捕获GEO输入:
This regexp validates and captures GEO input:
- 纬度,经度
- 经度
- 直接从GoogleMaps复制的坐标
这篇关于Zend Framework 2-Doctrine 2-如何使用GeoPointFields的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文