ttskch / symfony-micro-skeleton
dev-main
2021-03-05 05:04 UTC
Requires
- php: ^7.1.3
- ext-ctype: *
- ext-iconv: *
- sensio/framework-extra-bundle: ^5.6
- symfony/asset: 4.4.*
- symfony/console: 4.4.*
- symfony/dotenv: 4.4.*
- symfony/flex: ^1.10
- symfony/form: 4.4.*
- symfony/framework-bundle: 4.4.*
- symfony/monolog-bundle: ^3.6
- symfony/twig-bundle: 4.4.*
- symfony/validator: 4.4.*
- symfony/web-link: 4.4.*
- symfony/webpack-encore-bundle: ^1.8
- symfony/yaml: 4.4.*
Requires (Dev)
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.4
- symfony/debug-pack: *
- symfony/maker-bundle: ^1.14
- symfony/test-pack: *
- symfony/thanks: ^1.2
Conflicts
This package is auto-updated.
Last update: 2023-01-11 01:07:26 UTC
README
用于开始使用Symfony的框架,具有以下功能。
- OGP准备就绪
- 基于Bootstrap4的模板
- 基于Bootstrap4的美观表单主题
- font-awesome准备就绪
- select2 和 bootstrap4 主题 准备就绪
- 支持scss(通过 symfony/webpack-encore)
要求
- PHP 7.1.3+
- npm
安装
$ composer create-project ttskch/symfony-skeleton:@dev {project-name}
使用
$ symfony server:start
如果您没有 symfony 命令,请首先安装它。
表单主题
重新排列 twig.form_themes
数组元素以指定默认主题。
# config/packages/twig.yaml twig: form_themes: - 'form_theme/bootstrap_4_layout.html.twig' # - 'form_theme/bootstrap_4_horizontal_layout.html.twig' # to be the default theme
您还可以如下设置任意表单的主题。
{% form_theme form 'form_theme/your_own_form_theme.html.twig' %} {{ form(form) }}
默认外观
发送前 | 带错误 | |
---|---|---|
水平 | ||
垂直 |
开发
脚手架
您可以使用如下的 bin/console make:
命令创建新的类。
$ bin/console list make Available commands for the "make" namespace: make:auth Creates a Guard authenticator of different flavors make:command Creates a new console command class make:controller Creates a new controller class make:crud Creates CRUD for Doctrine entity class make:entity Creates or updates a Doctrine entity class, and optionally an API Platform resource make:fixtures Creates a new class to load Doctrine fixtures make:form Creates a new form class make:functional-test Creates a new functional test class make:message Creates a new message and handler make:messenger-middleware Creates a new messenger middleware make:migration Creates a new migration based on database changes make:registration-form Creates a new registration form system make:reset-password Create controller, entity, and repositories for use with symfonycasts/reset-password-bundle. make:serializer:encoder Creates a new serializer encoder class make:serializer:normalizer Creates a new serializer normalizer class make:subscriber Creates a new event subscriber class make:twig-extension Creates a new Twig extension class make:unit-test Creates a new unit test class make:user Creates a new security user class make:validator Creates a new validator and constraint class make:voter Creates a new security voter class
资产
assets
目录中的所有资产都将使用 Webpack Encore 打包到 public/build
目录。
$ npm run dev # encore dev $ npm run watch # encore dev --watch $ npm run build # encore production # or $ yarn dev $ yarn watch $ yarn build