kitlabs / kit-generator-bundle
扩展 SensioGeneratorBundle
v4.1.0
2023-08-04 10:21 UTC
Requires
- php: >=5.5.9
- knplabs/knp-paginator-bundle: ^5.9
- sensio/generator-bundle: >=v3.0
- dev-master
- v4.1.0
- v4.0.0
- v3.0.1
- v3.0.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.x-dev
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.7
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.9
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.3
- v0.1.2
- v0.1.1
This package is auto-updated.
Last update: 2024-09-04 14:24:10 UTC
README
扩展 SensioGeneratorBundle
安装
步骤 1:下载包
打开命令行,进入您的项目目录,并执行以下命令以下载此包的最新稳定版本
$ composer require kitlabs/kit-generator-bundle
此命令需要您全局安装了Composer,具体请参考Composer文档中的安装章节。
步骤 2:启用包
然后,将包添加到项目app/AppKernel.php
文件中已注册的包列表中来启用它
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
// ...
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
// ...
if ('dev' === $this->getEnvironment()) {
// ...
$bundles[] = new Kit\GeneratorBundle\KitGeneratorBundle(),
}
}
}
// ...
}
使用方法
//add table & field option comment
$ php7 bin/console kit:doctrine:generate:entity
Welcome to the kitlabs Doctrine2 entity generator
This command helps you generate Doctrine2 entities.
First, you need to give the entity name you want to generate.
You must use the shortcut notation like AcmeBlogBundle:Post.
The Entity shortcut name: MessageBundle:Test
Enter table comment: this_is_table_comment #add table option comment
Determine the format to use for the mapping information.
Configuration format (yml, xml, php, or annotation) [annotation]:
Instead of starting with a blank entity, you can add some fields now.
Note that the primary key will be added automatically (named id).
Available types: array, simple_array, json_array, object,
boolean, integer, smallint, bigint, string, text, datetime, datetimetz,
date, time, decimal, float, binary, blob, guid.
New field name (press <return> to stop adding fields): test_id
Field type [integer]:
Is nullable [false]:
Unique [false]:
Options:comment: this_is_field_comment # add table filed comment
New field name (press <return> to stop adding fields):
Entity generation
created ./src/MessageBundle/Entity/Test.php
> Generating entity class src/MessageBundle/Entity/Test.php: OK!
> Generating repository class src/MessageBundle/Repository/TestRepository.php: OK!
Everything is OK! Now get to work :).
kit:doctrine:generate:crud # generate controller, router and views
//theme
kit:doctrine:generate:crud:theme --theme=Pintuer