Open weaverryan opened 11 months ago
Update your src/Twig/TwigPreLexer.php
and add this block line 209 (before the variadic check)
if ($this->check('{{ stimulus_') || $this->check('{{stimulus_')) {
$this->consume('{{');
$attributes[] = '...' . trim($this->consumeUntil('}}'));
$this->consume('}}');
continue;
}
// rest of the file
if ($this->check('{{...') || $this->check('{{ ...')) {
$this->consume('{{...');
Is this the expected behaviour ?
But now twig support the spread operator? I think we can do that at the stimulus_action
function level
I'm not sure to get... how could we handle this inside the function ?
I think I ran into the same problem.
I was trying to put symfony form stuff inside of a component like this:
<twig:ChipGroup {{ block('widget_container_attributes') }}>
....
</twig:ChipGroup>
It does not work which makes combining twig components and symfony forms quite difficult...
You cannot "write content" inside the block tag (as you cannot inside any twig tag).. because it as a syntax.
This block should be on the div inside your template
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Just a quick reminder to make a comment on this. If I don't hear anything I'll close this.
Hey,
I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!
Hi!
This is something I keep wanting to do:
I know why this doesn't work :). But from a user's perspective, I can't think of why it shouldn't. If we see a Twig
{{
where we expect an attribute, then we should translate it effectively into a...stimulus_action('say', 'hello')
so its return value merges into the other props.