-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #860 Add support for Symfony UX Turbo (dunglas)
This PR was squashed before being merged into the 1.0-dev branch. Discussion ---------- Add support for Symfony UX Turbo This PR adds a new `--broadcast` to the `make:entity` command. This generates the required template to use the broadcasting feature of UX Turbo, and also add the `#[Broadcast]` attribute to the generated entity. Commits ------- 5aab43a Add support for Symfony UX Turbo
- Loading branch information
Showing
7 changed files
with
114 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Resources/skeleton/doctrine/broadcast_twig_template.tpl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{# Learn how to use Turbo Streams: https://github.com/symfony/ux-turbo#broadcast-doctrine-entities-update #} | ||
{% block create %} | ||
<turbo-stream action="append" target="<?= $class_name_plural ?>"> | ||
<template> | ||
<div id="{{ '<?= $class_name ?>_' ~ id }}"> | ||
#{{ id }} created | ||
</div> | ||
</template> | ||
</turbo-stream> | ||
{% endblock %} | ||
|
||
{% block update %} | ||
<turbo-stream action="update" target="<?= $class_name ?>_{{ id }}"> | ||
<template> | ||
#{{ id }} updated | ||
</template> | ||
</turbo-stream> | ||
{% endblock %} | ||
|
||
{% block remove %} | ||
<turbo-stream action="remove" target="<?= $class_name ?>_{{ id }}"></turbo-stream> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters