首页 文章

制作Sylius插件:找不到“GET / admin / seller /”的路由

提问于
浏览
0

我正在尝试为Sylius中的实体卖家管理定义路由 . 当我尝试访问页面http://127.0.0.1:8000/admin/sellers/时,我遇到了这些错误:

Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException:在/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / HttpKernel中找不到“GET / admin / sellers /”的路由/EventListener/RouterListener.php:139 at Symfony \ Component \ HttpKernel \ EventListener \ RouterListener-> onKernelRequest(object(GetResponseEvent),'kernel.request',object(TraceableEventDispatcher))at call_user_func(array(object(RouterListener),'onKernelRequest) '),object(GetResponseEvent),'kernel.request',object(TraceableEventDispatcher))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / EventDispatcher / Debug / WrappedListener .php:104)在Symfony \ Component \ EventDispatcher \ Debug \ WrappedListener - > __ invoke(object(GetResponseEvent),'kernel.request',object(ContainerAwareEventDispatcher))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony的/ symfony的/ SRC / Symfony的/分量/EventDispatcher/EventDispatcher.php:212)在Symfony \ Component \ EventDispatcher \ EventDispatcher-> doDispatch(array(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object( WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object( WrappedListener),object(WrappedListener)),'kernel.request',object(GetResponseEvent))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / EventDispatcher / EventDispatcher . php:44)在Symfony \ Component \ EventDispatcher \ EventDispatcher-> dispatch('kernel.request',object(GetResponseEvent))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony /组件/此事件/调试/ TraceableEventDisp atcher.php:139)在Symfony \ Component \ EventDispatcher \ Debug \ TraceableEventDispatcher-> dispatch('kernel.request',object(GetResponseEvent))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony /src/Symfony/Component/HttpKernel/HttpKernel.php:129)在Symfony \ Component \ HttpKernel \ HttpKernel-> handleRaw(object(Request),1)(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / HttpKernel / HttpKernel.php:68)在Symfony \ Component \ HttpKernel \ HttpKernel-> handle(object(Request),1,true)(/ home / robomatix / www / html_local / Artaban) /SyliusSimpleMarketplacePlugin/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202)在Symfony \ Component \ HttpKernel \ Kernel-> handle(object(Request))(web / app_dev.php:16)at at require('/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / tests / Application / web / app_dev.php')(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor /symfony/symfony/src/Symfony/Bundle/WebServerBundle/Resources/router.php:42)

Symfony \ Component \ Routing \ Exception \ ResourceNotFoundException:at /tmp/a99a18f5531c358fe4a7a5bc81471b03/cache/appDevDebugProjectContainerUrlMatcher.php:3988 at appDevDebugProjectContainerUrlMatcher-> match('/ admin / sellers /')(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / Routing / Matcher / UrlMatcher.php:95)在Symfony \ Component \ Routing \ Matcher \ UrlMatcher-> matchRequest(object(Request))(/ home / robomatix / www) /html_local/Artaban/SyliusSimpleMarketplacePlugin/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:262)在Symfony \ Component \ Routing \ Router-> matchRequest(object(Request))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / HttpKernel / EventListener / RouterListener.php:109)在Symfony \ Component \ HttpKernel \ EventListener \ RouterListener-> onKernelRequest(object(GetResponseEvent),' kernel_request',object(TraceableEventDispatcher))在call_user_func(a rray(object(RouterListener),'onKernelRequest'),object(GetResponseEvent),'kernel.request',object(TraceableEventDispatcher))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / EventDispatcher / Debug / WrappedListener.php:104)在Symfony \ Component \ EventDispatcher \ Debug \ WrappedListener - > __ invoke(object(GetResponseEvent),'kernel.request',object(ContainerAwareEventDispatcher))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / EventDispatcher / EventDispatcher.php:212)在Symfony \ Component \ EventDispatcher \ EventDispatcher-> doDispatch(array(object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener), object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener),object(WrappedListener)),'kernel.request',object(GetResponseEvent))(/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / vendor / symfony / symfony / src / Symfony / Component / EventDispatcher / EventDispatcher.php:44)在Symfony \ Component \ EventDispatcher \ EventDispatcher-> dispatch('kernel.request',object(GetResponseEvent))( /home/robomatix/www/html_local/Artaban/SyliusSimpleMarketplacePlugin/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:139)at Symfony \ Component \ EventDispatcher \ Debug \ TraceableEventDispatcher-> dispatch(' kernel.request',object(GetResponseEvent)) (/home/robomatix/www/html_local/Artaban/SyliusSimpleMarketplacePlugin/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:129)在Symfony \ Component \ HttpKernel \ HttpKernel-> handleRaw(object(Request)) ,1)(/home/robomatix/www/html_local/Artaban/SyliusSimpleMarketplacePlugin/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)at Symfony \ Component \ HttpKernel \ HttpKernel-> handle(object (请求),1,true)(/home/robomatix/www/html_local/Artaban/SyliusSimpleMarketplacePlugin/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:202)at Symfony \ Component \ HttpKernel \ Kernel - > handle(object(请求))(web / app_dev.php:16)at require('/ home / robomatix / www / html_local / Artaban / SyliusSimpleMarketplacePlugin / tests / Application / web / app_dev.php')(/ home / robomatix /网络/ html_local / Artaban / SyliusSimpleMarketplacePlugin /供应商/ symfony的/ symfony的/ SRC / Symfony的/捆绑/ WebServerBundle /资源/ router.php:42)

对不起,我无法使用代码实现...

这是我的代码:

Artaban / SyliusSimpleMarketplacePlugin / src目录/资源/配置/ config.yml

imports:
    - { resource: 
 "@ArtabanSyliusSimpleMarketplacePlugin/Resources/config/services.yml" 
}
- { resource: 
"@ArtabanSyliusSimpleMarketplacePlugin/Resources/config/resources.yml" 
}
- { resource: "@ArtabanSyliusSimpleMarketplacePlugin/Resources/config/grids/grids.yml" 
}

Artaban / SyliusSimpleMarketplacePlugin / src目录/资源/配置/ resources.yml

sylius_resource:
    resources:
        app.seller:
            driver: doctrine/orm # You can use also different driver here
            classes:
                model: Artaban\SyliusSimpleMarketplacePlugin\Entity\ArtabanSimpleMarketplace_Seller

Artaban / SyliusSimpleMarketplacePlugin / src目录/资源/配置/格/管理/ seller.yml

sylius_grid:
grids:
    app_admin_seller:
        driver:
            name: doctrine/orm
            options:
                class: Artaban\SyliusSimpleMarketplacePlugin\Entity\ArtabanSimpleMarketplace_Seller
        fields:
            name:
                type: string
                label: sylius.ui.name
            description:
                type: string
                label: sylius.ui.description
            enabled:
                type: twig
                label: sylius.ui.enabled
                options:
                    template: "@SyliusUi/Grid/Field/enabled.html.twig"
        actions:
            main:
                create:
                    type: create
            item:
                update:
                    type: update
                delete:
                    type: delete

Artaban / SyliusSimpleMarketplacePlugin / src目录/资源/配置/格/ grids.yml

imports:
- { resource: '@ArtabanSyliusSimpleMarketplacePlugin/Resources/config/grids/admin/seller.yml' }

Artaban / SyliusSimpleMarketplacePlugin / src目录/资源/配置/路由/管理/ seller.yml

app_admin_seller:
resource: |
    alias: app.seller
    section: admin
    templates: SyliusAdminBundle:Crud
    redirect: update
    grid: app_admin_seller
    vars:
        all:
            subheader: app.ui.seller
        index:
            icon: 'file image outline'
type: sylius.resource

Artaban / SyliusSimpleMarketplacePlugin / src目录/资源/配置/路由/ admin.yml

app_admin_seller:
resource: '@ArtabanSyliusSimpleMarketplacePlugin/Resources/config/routing/admin/seller.yml'

Artaban / SyliusSimpleMarketplacePlugin / src目录/资源/配置/ routing.yml中

app_admin:
resource: '@ArtabanSyliusSimpleMarketplacePlugin/Resources/config/routing/admin.yml'
prefix: /admin

对不起,如果我发布太多代码和未格式化的错误消息...

所以,如果有人可以帮我弄清楚如何显示一个页面“admin / sellers”,我可以CRUD卖家,我会很高兴!

1 回答

  • 0

    根据您发布的内容,您未在 app/config/routing.yml 配置中导入 Artaban/SyliusSimpleMarketplacePlugin/src/Resources/config/routing/admin.yml .

相关问题