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

Listener on dispatch instead of render #5

Open
chielsen opened this issue Mar 24, 2024 · 1 comment
Open

Listener on dispatch instead of render #5

chielsen opened this issue Mar 24, 2024 · 1 comment

Comments

@chielsen
Copy link

Hi,

I am implementing this library, but now I run into the fact that the listener listens on an dispatch event with quite high priority. What is the reason for this?
As you are triggering a function renderAssets this does not make sense. For instance if your controller forwards to another controller, you cannot use that information because that happens on a lower prio dispatch event.
Could it be changed to trigger on render?

See \Fabiang\AsseticBundle\Listener->attach

@fabiang
Copy link
Owner

fabiang commented Mar 25, 2024

Hello,

thank you for pointing this out.

As far as I can see it's important for the check for acceptable errors. This and the priority of 32 comes from the original fork. Without further testing I assume the event listener could be changed to the events MvcEvent::EVENT_RENDER and MvcEvent::EVENT_RENDER_ERROR, since the error should be available too there.

Honestly this library, while still supported by me, is very low on my priority list, as there are better solutions out there for managing assets. So if you willing to do further investigations and open a pull request, I'm happy to merge the solution.

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

No branches or pull requests

2 participants