whitebear
whitebear

Reputation: 12423

Simple routing doesn't work on symfony

I added this to routing.yml

# app/config/routing.yml
sonata_media_pixlr:
    resource: '@SonataMediaBundle/Resources/config/routing/pixlr.xml'
    prefix: /admin/media

and this to sonata_media.yml

# app/config/sonata_media.yml
sonata_media:
    # ...
    pixlr:
        enabled:  true
        secret:   theSecretHash
        referrer: Application Name

then access /web/app_dev.php/admin/media

No route found for "GET /admin/media"

I think this is just the simplest routing way.

However it doesn't work. I made cache cleared.

Is there anything I need to check??

Or Is there any command to check how the route is mapping??

these are my routing.yml below

admin_area:
    resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
    prefix: /admin

_sonata_admin:
    resource: .
    type: sonata_admin
    prefix: /admin

acme_member:
    resource: "@AcmeMemberBundle/Resources/config/routing.yml"
    prefix:   /member

_user_bundle:
    resource: "@UserBundle/Resources/config/routing.yml"

acme_top:
    resource: "@AcmeTopBundle/Resources/config/routing.yml"
    prefix:   /

fos_user_group:
    resource: "@FOSUserBundle/Resources/config/routing/group.xml"
    prefix: /group


sonata_page_cache:
    resource: '@SonataCacheBundle/Resources/config/routing/cache.xml'
    prefix: /

gallery:
    resource: '@SonataMediaBundle/Resources/config/routing/gallery.xml'
    prefix: /media/gallery

media:
    resource: '@SonataMediaBundle/Resources/config/routing/media.xml'
    prefix: /media

_liip_imagine:
    resource: "@LiipImagineBundle/Resources/config/routing.xml"


fos_js_routing:
  resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
 #FosUserBundle Routes
sonata_media_pixlr:
    resource: '@SonataMediaBundle/Resources/config/routing/pixlr.xml'
    prefix: /admin/media

Upvotes: 1

Views: 305

Answers (2)

ECR
ECR

Reputation: 1

By integating with SonataMediaBundle, you have to set in routing.yml file:

sonata_media_pixlr:
    resource: '@SonataMediaBundle/Resources/config/routing/pixlr.xml'
    prefix: /sonata/media

Upvotes: 0

JeromeH
JeromeH

Reputation: 61

You can check all your route with following command:

php app/console router:debug

I don't know how to work sonata bundle but may be in internal it already uses this route or route like admin/{var}. And you don't show your pixlr.xml, do you have any route configured in ?

Upvotes: 2

Related Questions