chaplean/location-bundle

位置包包含实体区域/部门/城市

安装: 932

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

公开问题: 0

类型:symfony-bundle

v10.0.5 2019-07-09 20:11 UTC

README

先决条件

此版本的位置包需要 Symfony 2.8+。

安装

1. Composer

composer require chaplean/location-bundle

2. AppKernel.php

添加

new Chaplean\Bundle\LocationBundle\ChapleanLocationBundle(),

3. 注入位置

运行

bin/console location:load:cities

或在迁移中添加命令

public function postUp(Schema $schema)
{
    /** @var Kernel $kernel */
    $kernel = $this->container->get('kernel');
    $application = new Application($kernel);
    $application->setAutoExit(false);
    

    $exitCode = $application->run(
        new ArrayInput(
            [
                'command'    => 'location:load:cities'
            ]
        )
    );
    
    $this->abortIf($exitCode !== 0, 'see Exception above ^');
}

4. 资源