我正试图在Sylius中制作我的第一个网格。
https://sylius-older.readthedocs.io/en/latest/bundles/SyliusGridBundle/your_first_grid.html#generating-积垢路线
我创建了实体供应商和供应商接口。然后创建了包含以下内容的config/packages/resources.yaml文件:
sylius_resource:
resources:
app.supplier:
classes:
model: AppEntitySupplier
现在我想为CRUD操作添加一个路由:
sylius_admin:
resource: "@SyliusAdminBundle/Resources/config/routing.yml"
prefix: '/%sylius_admin.path_name%'
sylius_paypal_admin:
resource: "@SyliusPayPalPlugin/Resources/config/admin_routing.yml"
prefix: '/%sylius_admin.path_name%'
app_supplier:
resource: |
alias: app.supplier
section: admin
templates: SyliusAdminBundle:Crud
except: ['show']
grid: app_admin_supplier
type: sylius.resource
prefix: /admin
但是我的/admin/providers/new向我显示了一个错误:
Unable to find template "SyliusAdminBundle:Crud:create.html.twig" (looked into: /var/www/html/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views, /var/www/html/templates, /var/www/html/templates, /var/www/html/vendor/symfony/twig-bridge/Resources/views/Form).
我在从1.8更新到1.9时遇到了同样的问题。
通过更改线路解决了问题
templates: SyliusAdminBundle:Crud
至
templates: "@SyliusAdmin\Crud"
在您的路线中(在您的情况下,在app_supplier下(。