vivi / nakima-payment-bundle
此包最新版本(0.0.1)没有提供许可信息。
我的酷炫项目必须有一个酷炫的描述
0.0.1
2017-03-30 11:29 UTC
Requires
- php: >=7.1
This package is auto-updated.
Last update: 2024-09-14 10:38:59 UTC
README
首先,我们将使用此仓库来获取项目的代码库。
- 克隆此仓库
git clone git@bitbucket.org:nkm_solutions/basephpproject.git my-proyect cd my-proyectrm -rf .gitcomposer update- 可选:
composer autoload dump - 打开 composer.json 文件,需要进行以下更改
- 'Base' 替换为你的项目基础命名空间:
Nakima\\GeoBundle\\ - "name": "vivi/nakima-___-bundle"
- 'Base' 替换为你的项目基础命名空间:
一旦我们有了代码库,我们就在新的仓库中添加它。
git initgit remote add origin git@bitbucket.org:nkm_solutions/____________.gitgit add .git commit -m "Initial commit with BasePHPProject"git push -u origin master
然后,如果我们想在 PACKAGIST 中添加此仓库,我们将执行以下步骤
- 导航到: https://packagist.org.cn/packages/submit
- 添加仓库的 HTTP URL,无需 USERNAME
- 自动更新:添加以下 webhook
最后,通过 composer 将仓库添加到 symfony 并更新到 SSH。
#!bash
composer require vivi/nakima-_______-bundle dev-master
cd vendor/vivi/nakima-_______-bundle
git remote set-url origin git@bitbucket.org:nkm_solutions/nakima______bundle.git
到此,我们就准备好了 :)
如何从头创建一个新的 Symfony 3 Bundle
假设新的 Bundle 名称是: NakimaGeoBundle
将 "src/Main.php" 文件重命名为 "src/NakimaGeoBundle.php"
#!php <?php namespace Nakima\GeoBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class NakimaGeoBundle extends Bundle {}创建一个名为 bundle 的文件夹,在其中放置将安装到具体项目中的文件。
创建 "bundle/GeoBundle.php"
#!php <?php namespace GeoBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class GeoBundle extends Bundle {}创建配置文件
src
- src/Resources/config/admin.yml
- src/Resources/config/config.yml
- src/Resources/config/routing.yml
bundle
bundle/Resources/config/admin.yml
#!yaml imports: - { resource: "@NakimaGeoBundle/Resources/config/admin.yml" }bundle/Resources/config/config.yml
#!yaml imports: - { resource: "@NakimaGeoBundle/Resources/config/config.yml" }bundle/Resources/config/routing.yml
#!yaml nakima_geo: resource: "@NakimaGeoBundle/Resources/config/routing.yml" prefix: /
修改 "AppKernel.php"
#!yaml ... // NAKIMA ... new Nakima\GeoBundle\NakimaGeoBundle(), ...将创建的 Bundle 添加到当前项目中。执行
#!bash php bin/console nakima:bundle:install geo在执行要求的项目中,修改 "app/config/config.yml" 文件。添加以下内容
#!yaml imports: ... # Import bundles config ... - { resource: "@GeoBundle/Resources/config/config.yml" } # Import admin settings ... - { resource: "@GeoBundle/Resources/config/admin.yml" } ...修改 "AppKernel.php"
#!yaml ... // NAKIMA ... ... new GeoBundle\GeoBundle(), ...
新实体
"src/Entity/Country.php"
#!php <?php namespace Nakima\GeoBundle\Entity; use Doctrine\ORM\Mapping\Entity; ... use Nakima\CoreBundle\Entity\BaseEntity; /** * @MappedSuperclass */ class Country extends BaseEntity { ... /************************************************************************** * Custom Functions * **************************************************************************/ public function __toString() { return $this->_______; } /************************************************************************** * Getters & Setters * **************************************************************************/ ... }"bundle/Entity/Country.php"
#!php <?php namespace GeoBundle\Entity; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\Table; use Nakima\GeoBundle\Entity\Country AS BaseCountry; /** * @Entity * @Table(name="_country") */ class Country extends BaseCountry {}"src/Resources/config/admin.yml"
#!yaml nakima_admin: blocks: country_entity: class: Nakima\AdminBundle\Block\EntityBlock meta: type: entity label: Countries entity: GeoBundle\Entity\Country icon: 'circle-o' icon_color: 'x' # optionals admin: Nakima\AdminBundle\Admin\BaseAdmin controller: NakimaAdminBundle:BaseAdmin在 "bundle/Resources/config/admin.yml" 中追加
#!yaml ... nakima_admin: blocks: country_entity: meta: icon_color: 'green'手动将项目主目录中的更改添加到项目中。
使用模式更新进行检查
#!bash php bin/console doctrine:schema:update --force