Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imagine with Doctrine\Phpcr\Image documents #59

Open
dbu opened this issue Sep 16, 2013 · 2 comments
Open

Imagine with Doctrine\Phpcr\Image documents #59

dbu opened this issue Sep 16, 2013 · 2 comments
Milestone

Comments

@dbu
Copy link
Member

dbu commented Sep 16, 2013

when i try to use imagine with an Image document, i get

Parameter "path" for route "_imagine_my_filter" must match ".+" ("" given) 
to generate a corresponding URL

it works if i add a __toString method to the image that returns $this->id. it seems like LiipImagineBundle is not expecting to be passed an object but only a path to an object. can we make that work? things go wrong inside CacheManager / WebPathResolver. could we use a different path resolver?

workaround: if i pass in the id instead of the Image document, things work so at least there is a workaround.

@rmsint
Copy link
Contributor

rmsint commented Sep 16, 2013

Maybe this can be solved on LiipImagineBundle side, some ideas:

  • using an LiipImagineBundle interface that is implemented on the Doctrine\Phpcr\Image document
  • using a PathResolverManager that can handle multiple path resolvers, then we could inject one for ImageInterface objects
  • or simply add some mapping, so it can be configured what field is used to get the path per interface/ class

@dbu
Copy link
Member Author

dbu commented Sep 17, 2013

right now the parameter to the imagine filter is called $path and expected to be a string. maybe there is a way to extend WebPathResolver to a ImageOrWebPathResolver and configure LiipImagineBundle to use that.

anyway, its not a 1.0 critical thing, as passing image.id is a working solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants