latenal/mexican-postal-codes 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

latenal/mexican-postal-codes

Composer 安装命令:

composer require latenal/mexican-postal-codes

包简介

PostalCodes plugin for CakePHP

README 文档

README

Installation

You can install this plugin into your CakePHP application using composer.

1. Install the plugin via composer.

Add to composer.json:

composer require latenal/mexican-postal-codes

After that, call:

composer install

2. Load plugin in cake:

bin/cake plugin load PostalCodes

3. Then, apply migrations and seeds:

bin/cake migrations migrate --plugin PostalCodes
bin/cake migrations seed --plugin PostalCodes

Usage

In your controller add:

$this->loadComponent('PostalCodes.PostalCode', []);

Get a list of states

$states = $this->PostalCode->states()->toArray();

Get a list of municipalities by state id

$state_id = 1;
$municipalities = $this->PostalCode->municipalities($state_id)->toArray();

Get a list of colonies by state id and municipality name

$state_id = 1;
$municipality = 'Álvaro Obregón';
$colonies = $this->PostalCode->colonies($state_id, $municipality)->toArray();

Get a state and municipality by postal code

$postal = '06760';
$addr = $this->PostalCode->getStateAndMuncipalityByPostalCode($postal)->first();

Get a list of colonies by postal code

$postal = '06760';
$colonies = $this->PostalCode->getColoniesByPostalCode($postal)->toArray();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固