Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ux.symfony.com/config/packages/twig_component.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
twig_component:
defaults:
App\Twig\: 'components/'
App\Twig\Components\: 'components/'

# Custom namespace for MemoryDemo
App\LiveMemory\Component\:
template_directory: 'demos/live_memory/components/LiveMemory/'
name_prefix: 'LiveMemory:'


#anonymous_template_directory: 'demos/live_memory/components/'
anonymous_template_directory: 'components/'
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Service\DinoStatsService;
use Symfony\UX\Chartjs\Builder\ChartBuilderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
use Symfony\UX\TwigComponent\Attribute\ExposeInTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Entity\Food;
use App\Repository\FoodRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Model\UxPackage;
use App\Service\UxPackageRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Entity\Food;
use Doctrine\ORM\EntityManagerInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Entity\Invoice;
use App\Entity\InvoiceItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Entity\Product;
use App\Repository\ProductRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Form\MealPlannerForm;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Entity\Category;
use Doctrine\ORM\EntityManagerInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Entity\Category;
use App\Entity\Product;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Service\EmojiCollection;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Service\EmojiCollection;
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Form\RegistrationFormType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Util\SourceCleaner;
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use App\Entity\TodoList;
use App\Form\TodoListFormType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace App\Twig;
namespace App\Twig\Components;

use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/RegistrationForm.php" height="400px" />
<twig:CodeBlock filename="src/Twig/Components/RegistrationForm.php" height="400px" />
{% endblock %}

{% block code_block_right %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/TodoListForm.php" height="400px" />
<twig:CodeBlock filename="src/Twig/Components/TodoListForm.php" height="400px" />
{% endblock %}

{% block code_block_right %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/DinoChart.php" height="400px" />
<twig:CodeBlock filename="src/Twig/Components/DinoChart.php" height="400px" />
{% endblock %}

{% block code_block_right %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block code_block_full %}
<twig:Code:TabbedCodeBlocks :files="[
'src/Twig/MealPlanner.php',
'src/Twig/Components/MealPlanner.php',
'templates/components/MealPlanner.html.twig',
'src/Form/MealPlannerForm.php',
]" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/TodoListForm.php" height="400px" />
<twig:CodeBlock filename="src/Twig/Components/TodoListForm.php" height="400px" />
{% endblock %}

{% block code_block_right %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<section class="py-5" style="padding-top: 6rem;">
<div class="container container-xxl">
<twig:Code:CodeWithExplanationRow filename="src/Twig/ProductGrid.php" reversed sticky style="--bs-gutter-x: 4rem;">
<twig:Code:CodeWithExplanationRow filename="src/Twig/Components/ProductGrid.php" reversed sticky style="--bs-gutter-x: 4rem;">
This component is quite standard: the page number as a `LiveProp`, a `LiveAction`
to load the next page, and a `getItems` method to retrieve the page results.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/InlineEditFood.php" height="400px" />
<twig:CodeBlock filename="src/Twig/Components/InlineEditFood.php" height="400px" />
{% endblock %}

{% block code_block_right %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_full %}
<twig:Code:CodeWithExplanationRow filename="src/Twig/InvoiceCreator.php" sticky class="pt-5">
<twig:Code:CodeWithExplanationRow filename="src/Twig/Components/InvoiceCreator.php" sticky class="pt-5">
## Main Component

This main component keeps track of the `Invoice` (which may be new) and
Expand Down Expand Up @@ -30,7 +30,7 @@ data: `productId`, `quantity`, and `isEditing`. It also passes a `key`,
which is needed so LiveComponents can track which row is which.
</twig:Code:CodeWithExplanationRow>

<twig:Code:CodeWithExplanationRow filename="src/Twig/InvoiceCreatorLineItem.php" sticky class="pt-5">
<twig:Code:CodeWithExplanationRow filename="src/Twig/Components/InvoiceCreatorLineItem.php" sticky class="pt-5">
## Child Component

The child component for each "line item". This handles validating, saving,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% endblock %}

{% block code_block_full %}
<twig:Code:CodeWithExplanationRow filename="src/Twig/NewProductForm.php" sticky>
<twig:Code:CodeWithExplanationRow filename="src/Twig/Components/NewProductForm.php" sticky>
## New Product Form

Live component with a form, `ValidatableComponentTrait` and a
Expand All @@ -31,7 +31,7 @@ and `data-bs-target="#new-category-modal"`.
</twig:Code:CodeWithExplanationRow>

<twig:Code:CodeWithExplanationRow
filename="src/Twig/NewCategoryForm.php" sticky
filename="src/Twig/Components/NewCategoryForm.php" sticky
>
## New Category Form

Expand All @@ -45,7 +45,7 @@ the new `Category` to the database and then does two important things:
</twig:Code:CodeWithExplanationRow>

<twig:Code:TabbedCodeBlocks :files="[
'src/Twig/BootstrapModal.php',
'src/Twig/Components/BootstrapModal.php',
'templates/components/BootstrapModal.html.twig',
'assets/controllers/bootstrap-modal-controller.js',
]" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/UploadFiles.php" height="400px" />
<twig:CodeBlock filename="src/Twig/Components/UploadFiles.php" height="400px" />
{% endblock %}

{% block code_block_right %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends 'demos/live_demo.html.twig' %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/FoodVote.php" height="400px" />
<twig:CodeBlock filename="src/Twig/Components/FoodVote.php" height="400px" />
{% endblock %}

{% block code_block_right %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% endblock %}

{% block code_block_left %}
<twig:CodeBlock filename="src/Twig/Alert.php" height="330px"/>
<twig:CodeBlock filename="src/Twig/Components/Alert.php" height="330px"/>
{% endblock %}

{% block code_block_right %}
Expand Down