UrlShortenerBundle icon indicating copy to clipboard operation
UrlShortenerBundle copied to clipboard

Undefined variable: routeElements

Open farconada opened this issue 12 years ago • 1 comments

Hello

An exception has been thrown during the rendering of a template ("Notice: Undefined variable: routeElements in /var/www/html/Symfony/vendor/sly/url-shortener-bundle/Sly/UrlShortenerBundle/Router/Router.php line 57")

I have debugged a bit an I found that it "fails" at Router.php line 48 cause it returns false my entity Entity\Pregunta doesnt have a method getPregunta my route definition is AcmeBundle_pregunta_show: pattern: /pregunta/ver/{pregunta} defaults: { _controller: AcmeBundle:Pregunta:show }

I have used {pregunta} instead of {id} cause I think that is more readable. Should be better to look for the Entity identifier with relfection (reading Doctrine metadata) instead of looking for the "id" field in the route?

Thanks

farconada avatar Aug 31 '12 16:08 farconada

Hi!

First, thank you for this feedback! I've currently no time for fix this problem or adapt the bundle to a more flexible solution.

You can contribute with forking it and make a pull request, if you want. If you don't, I'll try to do it as soon as possible.

Thanks!

C.

Ph3nol avatar Aug 31 '12 19:08 Ph3nol