Controller Setup - MiguelFieira/AMO-HANDBOEK GitHub Wiki

Symfony is a PHP framework for web applications and a set of reusable PHP components. Symfony is used by thousands of web applications (including BlaBlaCar.com and Spotify.com) and most of the popular PHP projects (including Drupal and Magento).

Controller Setup

A controller is a PHP function you create that reads information from the Request object and creates and returns a Response object. The response could be an HTML page, JSON, XML, a file download, a redirect, a 404 error or anything else. The controller executes whatever arbitrary logic your application needs to render the content of a page.

A Controller is automatically made with make:form and are part of make:crud more info Here!

Creating a Controller

  1. Open your terminal
php bin/console make:controller
  1. Enter the name "DefaultController"

Result

// This should create a new Controller in src/Controller/DefaultController.

Result Result

Optional

  1. You can change the default path of a router with annotation! Routing Change
  2. You can change the default styling in src/templates/default/index.html.twig. Edit default

Or change it in the routes.yaml (Will be added soon)

Continue with adding a Database

⚠️ **GitHub.com Fallback** ⚠️