imatic / controller-bundle
编写简单控制器的组件
v5.0.7
2023-07-31 10:21 UTC
Requires
- php: ^7.4 || ^8.0
- ext-iconv: *
- imatic/data-bundle: ^5.0|^6.0
- symfony/form: ^4.4 || ^5.4 || ^6.2
- symfony/framework-bundle: ^4.4 || ^5.4 || ^6.2
- symfony/mime: ^4.4 || ^5.4 || ^6.2
- symfony/translation: ^4.4 || ^5.4 || ^6.2
- symfony/twig-bundle: ^4.4 || ^5.4 || ^6.2
Requires (Dev)
- ext-json: *
- doctrine/doctrine-fixtures-bundle: ^3.3
- doctrine/orm: ^2.7
- friendsofphp/php-cs-fixer: ^3.11
- imatic/testing: ^6.0.0
- phpmd/phpmd: ^2.6
- symfony/browser-kit: ^4.4 || ^5.4 || ^6.2
- symfony/css-selector: ^4.4 || ^5.4 || ^6.2
- symfony/phpunit-bridge: ^4.4 || ^5.4 || ^6.2
- symfony/security-bundle: ^4.4 || ^5.4 || ^6.2
- symfony/validator: ^4.4 || ^5.4 || ^6.2
- symfony/web-profiler-bundle: ^4.4 || ^5.4 || ^6.2
- symfony/yaml: ^4.4 || ^5.4 || ^6.2
Suggests
- imatic/importexport-bundle: Allows to use import and export apis
- dev-master
- v5.0.7
- v5.0.6
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v4.0.1
- v4.0
- v3.0.8
- v3.0.7
- v3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0
- 2.6.13
- 2.6.12
- 2.6.11
- 2.6.10
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.4.0
- dev-dependabot/composer/twig/twig-3.11.1
- dev-php8
- dev-dev-5.0
- dev-dev_update
- dev-travis
This package is auto-updated.
Last update: 2024-09-12 07:20:57 UTC
README
ImaticControllerBundle
此组件使您能够轻松编写各种操作的简单控制器。它大量使用了 ImaticDataBundle。因此,如果您尚未阅读,请先阅读其文档。
该组件允许您以两种形式编写简单操作:
- 使用流畅的接口
<?php use Imatic\Bundle\ControllerBundle\Controller\Api\ApiTrait; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Routing\Annotation\Route; /** * @Route("/user") */ class UserController extends Controller { use ApiTrait; /** * @Route("", name="app_user_list", methods={"GET"}) */ public function listAction() { return $this ->listing(new UserListQuery()) ->setTemplateName('AppImaticControllerBundle:Test:list.html.twig') ->getResponse(); } }
- 使用yaml
imatic_controller: resources: app_user_list: config: route: { path: /user } entity: User query: list: UserListQuery fields: - { name: name, format: text } - { age: age, format: number } actions: list: ~
进一步阅读
- 访问我们的 文档 了解此组件的所有功能。