<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Controller &#8211; The Eternal Path</title>
	<atom:link href="https://arasan.de/tag/controller/feed/" rel="self" type="application/rss+xml" />
	<link>https://arasan.de</link>
	<description>Arasan.de</description>
	<lastBuildDate>Thu, 15 Sep 2022 13:48:16 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://arasan.de/wp-content/uploads/2024/10/triquetra-512x512-1.png</url>
	<title>Controller &#8211; The Eternal Path</title>
	<link>https://arasan.de</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Symfony Todo App &#8211; TodosController: Create Route hinzufügen</title>
		<link>https://arasan.de/symfony-todo-app-todoscontroller-create-route-hinzufuegen/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Thu, 15 Sep 2022 13:48:15 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[Routes]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[SymfonyTodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=583</guid>

					<description><![CDATA[In diesem Schritt fügen wir eine neue Route für das Erstellen von Todos hinzu und passen den Namen der bisherigen Route an: Wir können uns die definierten Routen und Namen der jeweiligen Route per CLI ausgeben lassen: Über den Namen &#8222;app_todos.create&#8220; kommen wir an die Route zum Erstellen heran. Jetzt können wir das Twig Template&#8230;]]></description>
										<content:encoded><![CDATA[<ol style="margin: 20px"><li><a href="https://arasan.de/symfony-todoapp-projekt-mit-git-github-erstellen/">Symfony TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-todoscontroller-erstellen/">Symfony TodoApp &#8211; TodosController erstellen</a></li><li><a href="https://arasan.de/symfony-todoapp-twig-template-anpassen/">Symfony TodoApp &#8211; Twig Template anpassen</a></li><li><a href="https://arasan.de/symfony-todo-app-bootstrap-styles-hinzufuegen/">Symfony Todo App &#8211; Bootstrap Styles hinzufügen</a></li><li>Symfony Todo App &#8211; TodosController: Create Route hinzufügen</li><li><a href="https://arasan.de/symfony-todo-app-datenbankverbindung-erstellen/">Symfony Todo App &#8211; Datenbankverbindung erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-entity-repository-erstellen/">Symfony Todo App &#8211; Entity + Repository erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoitems-aus-tableplus-tabelle-anzeigen/">Symfony Todo App – TodoItems aus TablePlus Tabelle anzeigen</a></li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-erstellen-von-todoitems-erzeugen/">Symfony todo App &#8211; Formular für Erstellen von TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-bearbeiten-von-todoitems-erzeugen/">Symfony Todo App &#8211; Formular für Bearbeiten von TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todoapp-loeschen-funktion-fuer-todoitems-erzeugen/">Symfony TodoApp &#8211; Löschen-Funktion für TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todoapp-login-registrierung-hinzufuegen/">Symfony TodoApp &#8211; Login + Registrierung hinzufügen</a></li></ol>



<p class="wp-block-paragraph">In diesem Schritt fügen wir eine neue Route für das Erstellen von Todos hinzu und passen den Namen der bisherigen Route an:</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="2896" height="1646" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-add-create-route.png" alt="" class="wp-image-585"/></figure>



<p class="wp-block-paragraph">Wir können uns die definierten Routen und Namen der jeweiligen Route per CLI ausgeben lassen:</p>



<pre class="wp-block-code"><code>php bin/console debug:router</code></pre>



<figure class="wp-block-image size-full"><img decoding="async" width="1818" height="850" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-php-bin-console-debug-router.png" alt="" class="wp-image-587"/></figure>



<p class="wp-block-paragraph">Über den Namen &#8222;app_todos.create&#8220; kommen wir an die Route zum Erstellen heran.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="2900" height="1644" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-add-create-route-path-1.png" alt="" class="wp-image-590"/></figure>



<p class="wp-block-paragraph">Jetzt können wir das Twig Template für das Erstellen von Todos hinzufügen:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2896" height="1632" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-add-create-route-twig-template.png" alt="" class="wp-image-593"/></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1804" height="1674" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-add-create-route-twig-template-browser.png" alt="" class="wp-image-594"/></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Symfony TodoApp &#8211; TodosController erstellen</title>
		<link>https://arasan.de/symfony-todoapp-todoscontroller-erstellen/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Thu, 15 Sep 2022 12:33:09 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[SymfonyTodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=549</guid>

					<description><![CDATA[Bevor wir einen Controller mit Symfony erstellen können, brauchen wir ein paar zusätzliche Pakete: Jetzt können wir über das CLI einen TodosController erstellen: Im Browser können wir den TodosController über die Route &#8222;/todos&#8220; erreichen: Wir sehen die Antwort vom TodosController, ein Twig Template: Nun checken wir die Änderungen am TodosController und dem Twig Template ein:]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Bevor wir einen Controller mit Symfony erstellen können, brauchen wir ein paar zusätzliche Pakete:</p>


<ol style="margin: 20px"><li><a href="https://arasan.de/symfony-todoapp-projekt-mit-git-github-erstellen/">Symfony TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li>Symfony TodoApp &#8211; TodosController erstellen</li><li><a href="https://arasan.de/symfony-todoapp-twig-template-anpassen/">Symfony TodoApp &#8211; Twig Template anpassen</a></li><li><a href="https://arasan.de/symfony-todo-app-bootstrap-styles-hinzufuegen/">Symfony Todo App &#8211; Bootstrap Styles hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoscontroller-create-route-hinzufuegen/">Symfony Todo App &#8211; TodosController: Create Route hinzufügen</a></li><li><a href="https://arasan.de/symfony-todo-app-datenbankverbindung-erstellen/">Symfony Todo App &#8211; Datenbankverbindung erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-entity-repository-erstellen/">Symfony Todo App &#8211; Entity + Repository erstellen</a></li><li><a href="https://arasan.de/symfony-todo-app-todoitems-aus-tableplus-tabelle-anzeigen/">Symfony Todo App – TodoItems aus TablePlus Tabelle anzeigen</a></li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-erstellen-von-todoitems-erzeugen/">Symfony todo App &#8211; Formular für Erstellen von TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todo-app-formular-fuer-bearbeiten-von-todoitems-erzeugen/">Symfony Todo App &#8211; Formular für Bearbeiten von TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todoapp-loeschen-funktion-fuer-todoitems-erzeugen/">Symfony TodoApp &#8211; Löschen-Funktion für TodoItems erzeugen</a></li><li><a href="https://arasan.de/symfony-todoapp-login-registrierung-hinzufuegen/">Symfony TodoApp &#8211; Login + Registrierung hinzufügen</a></li></ol>



<pre class="wp-block-code"><code>composer require make</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1820" height="1038" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-composer-require-make.png" alt="" class="wp-image-553"/></figure>



<pre class="wp-block-code"><code>composer require annotations</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1832" height="828" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-composer-require-annotations.png" alt="" class="wp-image-556"/></figure>



<p class="wp-block-paragraph">Jetzt können wir über das CLI einen TodosController erstellen:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1816" height="494" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-php-bin-console-make-controller-todoscontroller.png" alt="" class="wp-image-558"/></figure>



<p class="wp-block-paragraph">Im Browser können wir den TodosController über die Route &#8222;/todos&#8220; erreichen:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1814" height="1680" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-browser.png" alt="" class="wp-image-559"/></figure>



<p class="wp-block-paragraph">Wir sehen die Antwort vom TodosController, ein <a href="https://symfony.com/doc/current/templates.html#twig-templating-language">Twig Template</a>:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2890" height="1644" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todos-twig-template.png" alt="" class="wp-image-565"/></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2884" height="1642" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-vscode.png" alt="" class="wp-image-563"/></figure>



<p class="wp-block-paragraph">Nun checken wir die Änderungen am TodosController und dem Twig Template ein:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2894" height="1632" src="https://arasan.de/wp-content/uploads/2022/09/symfony-symfapp-todoscontroller-twig-template-git-checkin.png" alt="" class="wp-image-566"/></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Laravel TodoApp &#8211; ListItem Form + Route + Controller erstellen</title>
		<link>https://arasan.de/laravel-todoapp-listitem-form-route-controller-erstellen/</link>
		
		<dc:creator><![CDATA[«Æ»]]></dc:creator>
		<pubDate>Thu, 08 Sep 2022 17:22:54 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[Form]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Route]]></category>
		<category><![CDATA[TodoApp]]></category>
		<guid isPermaLink="false">https://arasan.de/?p=357</guid>

					<description><![CDATA[In diesem Schritt erstellen wir das Formular, über das die Todo-Liste erweitert werden kann: Wir erstellen hier ein Formular mit einer Action, die eine eigene Route beim Senden des Formulars aufruft.Diese Route nennen wir &#8222;saveItem&#8220; &#8211; die Route werden wir gleich noch definieren.Außerdem haben wir ein verstecktes CSRF Eingabefeld mit &#8222;@csrf&#8220; erstellt, das automatisch ein&#8230;]]></description>
										<content:encoded><![CDATA[<ol style="margin: 20px"><li><a href="https://arasan.de/laravel-projekt-mit-git-github-erstellen/">Laravel TodoApp &#8211; Projekt mit Git + Github erstellen</a></li><li><a href="https://arasan.de/laravel-view-blade-template-in-atom-editor-bearbeiten/">Laravel TodoApp &#8211; View (Blade Template) in Atom Editor bearbeiten:</a></li><li><a href="https://arasan.de/laravel-mysql-datenbank-verbindung-konfigurieren/">Laravel TodoApp &#8211; MySQL Datenbank-Verbindung konfigurieren</a></li><li><a href="https://arasan.de/laravel-todoapp-model-migration-erstellen/">Laravel TodoApp &#8211; Model + Migration erstellen</a></li><li>Laravel TodoApp &#8211; ListItem Form + Route + Controller erstellen</li><li><a href="https://arasan.de/laravel-todoapp-formulardaten-in-logdatei-ausgeben/">Laravel TodoApp &#8211; Formulardaten in Logdatei ausgeben</a></li><li><a href="https://arasan.de/laravel-todoapp-formulardaten-in-tabelle-speichern/">Laravel TodoApp &#8211; Formulardaten in Tabelle speichern</a></li><li><a href="https://arasan.de/laravel-todoapp-listitems-aus-tabelle-ausgeben/">Laravel TodoApp &#8211; ListItems aus Tabelle ausgeben</a></li><li><a href="https://arasan.de/laravel-todoapp-todo-listitem-als-erledigt-markieren/">Laravel TodoApp &#8211; Todo ListItem als erledigt markieren</a></li><li><a href="https://arasan.de/laravel-todoapp-layout-erstellen/">Laravel TodoApp &#8211; Layout erstellen</a></li><li><a href="https://arasan.de/laravel-todoapp-bootstrap-hinzufuegen/">Laravel TodoApp &#8211; Bootstrap hinzufügen</a></li><li><a href="https://arasan.de/laravel-todoapp-welcome-blade-template-umbenennen-in-todos/">Laravel TodoApp &#8211; Welcome Blade Template umbenennen in Todos</a></li><li><a href="https://arasan.de/laravel-todoapp-todo-nur-eintragen-wenn-user-angemeldet/">Laravel TodoApp &#8211; Todo nur eintragen wenn User angemeldet</a></li><li><a href="https://arasan.de/laravel-todoapp-nur-eigene-todos-anzeigen-und-bearbeiten/">Laravel TodoApp &#8211; Nur eigene Todos anzeigen und bearbeiten</a></li></ol>



<p class="wp-block-paragraph">In diesem Schritt erstellen wir das Formular, über das die Todo-Liste erweitert werden kann:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2990" height="1664" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-erstellen.png" alt="" class="wp-image-358"/></figure>



<p class="wp-block-paragraph">Wir erstellen hier ein Formular mit einer Action, die eine eigene Route beim Senden des Formulars aufruft.<br>Diese Route nennen wir &#8222;saveItem&#8220; &#8211; die Route werden wir gleich noch definieren.<br>Außerdem haben wir ein verstecktes <a href="https://laravel.com/docs/9.x/csrf">CSRF Eingabefeld</a> mit &#8222;@csrf&#8220; erstellt, das automatisch ein Token einfügt.<br>Im Browser sieht das Formular folgendermaßen aus:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2220" height="820" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-browser.png" alt="" class="wp-image-359"/></figure>



<p class="wp-block-paragraph">Vor Erstellen der Route erstellen wir unseren Controller &#8222;TodoListController&#8220;, der die neue Route &#8222;saveItem&#8220; bearbeitet:</p>



<pre class="wp-block-code"><code>php artisan make:controller TodoListController</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1828" height="420" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-todolist-controller-erstellen.png" alt="" class="wp-image-363"/></figure>



<p class="wp-block-paragraph">Jetzt erstellen wir die <a href="https://laravel.com/docs/9.x/routing#basic-routing">Route in der Datei &#8222;web.php&#8220;</a>, die wir eben im Formular verwendet haben. Hier haben wir auch noch die Startroute in &#8222;root&#8220; benannt:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2990" height="1668" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-form-listitem-route-erstellen.png" alt="" class="wp-image-361"/></figure>



<p class="wp-block-paragraph">Die Route &#8222;saveItem&#8220; funktioniert nur über einen POST Request (unser Formular sendet die Daten als POST Request).<br>Der TodoListController erhält die Daten vom Formular, jetzt brauchen wir im Controller noch die Methode &#8222;saveItem&#8220;.<br>Zunächst machen wir in der Methode eine einfache Weiterleitung auf die &#8222;root&#8220; Route (das Formular wird abgeschickt und wird wieder angezeigt).</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2990" height="1662" src="https://arasan.de/wp-content/uploads/2022/09/laravel-todoapp-todolistcontroller-saveitem-methode-erstellen.png" alt="" class="wp-image-364"/></figure>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
