-
-
Notifications
You must be signed in to change notification settings - Fork 357
[ExpressionLanguage] Add function service
#1867
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
Comments
I think this is more something related to https://github.com/symfony/ux |
This has never been possible as i see it .. I believe expression language is used there to compose topic names based on the enttity props. Or am i missing something ? |
Yes but I saw in the documentation below that it was possible to use the |
... in the service container:) |
Yes, but the Maybe you can achieve what you want by tweaking the Symfony Container by using some Compiler Pass, or maybe you can go for an easier solution by moving your logic into a (static?) method in your entity. |
So, won't fix? |
Maybe we can find another alternative, instead of passing the whole container, we can inject a service that could be configured under |
Maybe let's use another word than fix ... as this is a request for a feature (that has never existed in the first place, right ? 😅) Could you give you the final usage you're looking after, so maybe we can suggest other ways to achieve it ? |
Yes, why not :).
Yes, it's true, you're right, sorry 😄.
Currently, when I put: <div id="book_{{ book.id }}" {{ turbo_stream_listen('book_detail_' ~ book.id) }}></div> it becomes: <div id="book_7" data-controller="symfony--ux-turbo--mercure-turbo-stream" data-symfony--ux-turbo--mercure-turbo-stream-topic-value="book_detail_7" data-symfony--ux-turbo--mercure-turbo-stream-hub-value="http://127.0.0.1:56215/.well-known/mercure"></div> But with a generator, this will hash/encode the This line <div id="book_{{ book.id }}" {{ turbo_stream_listen(('book_detail_' ~ book.id)|mercure_topic) }}></div> will then become: <div id="book_7" data-controller="symfony--ux-turbo--mercure-turbo-stream" data-symfony--ux-turbo--mercure-turbo-stream-topic-value="AiLvziwlkB5M9UpYKRyiHvDs/BK7t4T6B7CR48ropyA=" data-symfony--ux-turbo--mercure-turbo-stream-hub-value="http://127.0.0.1:56215/.well-known/mercure"></div> |
I like the idea, should it be something to add here or in the Mercure bundle ? |
You might as well do it directly in MercureBundle. But is there a downside? |
Thank you for this issue. |
No resolved. |
I still doubt this repo is the best place to implement this feature. |
Closed in favor of #2447 |
Symfony version(s) affected
7.0.7
Description
I have an error :
How to reproduce
I have the following entity:
But when I create a Book entity, I get the following error:
In my case,
$this->functions
isenum
andconstant
: https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/ExpressionLanguage/Parser.php#L242Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: