sgromada/symfony-crud-bundle

提供了一种快速创建CRUD(创建、读取、更新、删除)的特质

1.0.0 2023-11-19 22:37 UTC

This package is auto-updated.

Last update: 2024-09-20 22:20:32 UTC


README

使用示例

' #[Route('example', name: 'panel_example_')] class ExampleController extends AbstractController { use CrudTrait;

public function __construct(
    protected EntityManagerInterface $entityManager,
    protected string $class = Example::class,
    protected string $form = ExampleFormType::class,
    protected string $templatePath = 'example',
) {
}

} ''

然后在目录中创建twig文件,并调用路由 example/index.html.twig > panel_example_index example/show.html.twig > panel_example_show example/update.html.twig > panel_example_update example/create.html.twig > panel_example_create