Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Link resolver as a service#11

Open
robinvdvleuten wants to merge 1 commit into
prismicio:masterfrom
robinvdvleuten:link-resolver
Open

Link resolver as a service#11
robinvdvleuten wants to merge 1 commit into
prismicio:masterfrom
robinvdvleuten:link-resolver

Conversation

@robinvdvleuten

Copy link
Copy Markdown

The link resolver instance is now injected as a service for easier overwriting from other bundles through for example compiler passes.

The link resolver instance is now injected as a service.
@CHH

CHH commented May 4, 2015

Copy link
Copy Markdown
Contributor

👍

@CHH

CHH commented May 28, 2015

Copy link
Copy Markdown
Contributor

@erwan What would need to be done to get that merged?

This would make setup for previews much easier. Currently I've to make my own DefaultController to use my custom link resolver to resolve previews. With this PR I can simply configure my link resolver as the default.

@erwan

erwan commented Jun 1, 2015

Copy link
Copy Markdown
Contributor

Hi,

I'm not an expert at Symfony, are you positive it's something that everyone would want to use or is there some downside to it?

@CHH

CHH commented Jun 1, 2015

Copy link
Copy Markdown
Contributor

Hi,

I've custom templates for every document type and collection in Prismic. The templates are handled by custom controllers and actions, because they need some other data, or do some filtering as well. Therefore I need a custom link resolver so every link links to the right custom controllers/actions. I also need my custom link resolver to resolve the preview links to my custom controllers/actions (when clicking preview in Prismic).

I think this is a good idea because:

  1. It's something that's generally a good idea to do in Symfony. The link resolver is an extension point of the SDK, so it should be extendable in the bundle. And you can only do that through a compiler pass or the services.yml if it's a service.
  2. I would say as long as this bundle doesn't provide a more elaborate defined structure (e.g. one template per document type, collection templates) users will need to do their own custom controllers and templates. Therefore they need a custom link resolver to override the routes.

Does that make sense?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants