Skip to content

Commit 3545826

Browse files
committed
minor #1164 [Site] Use <twig: HTML syntax in demos (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Site] Use <twig: HTML syntax in demos * Replace remaining `{{ component(... }}` with `<twig:.. />` * Fix a route in product demo Commits ------- 12563dd [Site] Use <twig: HTML syntax in demos
2 parents b78a1f7 + 12563dd commit 3545826

16 files changed

+39
-52
lines changed

ux.symfony.com/src/Twig/NewProductForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ public function saveProduct(EntityManagerInterface $entityManager): Response
7373

7474
$this->addFlash('live_demo_success', 'Product created! Add another one!');
7575

76-
return $this->redirectToRoute('app_live_components_product_form');
76+
return $this->redirectToRoute('app_demo_live_component_product_form');
7777
}
7878
}

ux.symfony.com/templates/components/InvoiceCreator.html.twig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
</thead>
4545
<tbody>
4646
{% for key, line in lineItems %}
47-
{{ component('InvoiceCreatorLineItem', {
48-
key: key,
49-
productId: line.productId,
50-
quantity: line.quantity,
51-
isEditing: line.isEditing,
52-
}) }}
47+
<twig:InvoiceCreatorLineItem
48+
key="{{ key }}"
49+
productId="{{ line.productId }}"
50+
quantity="{{ line.quantity }}"
51+
isEditing="{{ line.isEditing }}"
52+
/>
5353
{% endfor %}
5454
</tbody>
5555
</table>

ux.symfony.com/templates/components/NewProductForm.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
8686
{% endblock %}
8787
{% block modal_body %}
88-
{{ component('NewCategoryForm') }}
88+
<twig:NewCategoryForm />
8989
{% endblock %}
9090
{% endcomponent %}
9191
</div>

ux.symfony.com/templates/demos/live_component/auto_validating_form.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
{% endblock %}
1010

1111
{% block demo_content %}
12-
{{ component('RegistrationForm') }}
12+
<twig:RegistrationForm />
1313
{% endblock %}

ux.symfony.com/templates/demos/live_component/chartjs.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
{% endblock %}
1010

1111
{% block demo_content %}
12-
{{ component('DinoChart') }}
12+
<twig:DinoChart />
1313
{% endblock %}

ux.symfony.com/templates/demos/live_component/dependent_form_fields.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
{% endblock %}
1010

1111
{% block demo_content %}
12-
{{ component('MealPlanner') }}
12+
<twig:MealPlanner />
1313
{% endblock %}

ux.symfony.com/templates/demos/live_component/form_collection_type.html.twig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
{% endblock %}
1010

1111
{% block demo_content %}
12-
{{ component('TodoListForm', {
13-
form: form,
14-
todoList: todoList
15-
}) }}
12+
<twig:TodoListForm :form="form" :todoList="todoList" />
1613
{% endblock %}
1714

ux.symfony.com/templates/demos/live_component/inline_edit.html.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@
99
{% endblock %}
1010

1111
{% block demo_content %}
12-
{{ component('InlineEditFood', {
13-
food: food
14-
}) }}
12+
<twig:InlineEditFood :food="food" />
1513
{% endblock %}

ux.symfony.com/templates/demos/live_component/invoice.html.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ we emit the event directly.
5555
{% block demo_content %}
5656
<div class="row">
5757
<div class="col-8">
58-
{{ component('InvoiceCreator', {
59-
invoice: invoice
60-
}) }}
58+
<twig:InvoiceCreator :invoice="invoice"/>
6159
</div>
6260
</div>
6361
<div class="mt-3">

ux.symfony.com/templates/demos/live_component/product_form.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends 'liveDemoBase.html.twig' %}
22

33
{% block demo_content %}
4-
{{ component('NewProductForm') }}
4+
<twig:NewProductForm />
55
{% endblock %}
66

77
{% block code_block_full %}

0 commit comments

Comments
 (0)