SF4C4 | Web Development with Symfony 4

  • This four day course dedicated to Symfony is the perfect training to master all the fundamental concepts and the most advanced tools of Symfony 4. At the end of this workshop, we guarantee you you'll be fully autonomous with the Symfony 4 framework and more! This training workshop is available online. Contact us and we'll tell you how.
  • Prerequisites

    Mastering PHP essentials
  • Goals

    This intensive four day training combines both the « SF4C1 / Getting Started with Symfony 4 » and « SF4C2 / Mastering Symfony 4 » courses and covers all the most important topics of Symfony 4. You'll start with the basics such as installing Symfony, navigating the directory structure and generating your very first dynamic web pages with Twig. Then, you'll dive more in depth in more advanced topics and tools like forms and data validation, authentication and authorizations, dependency injection, automated testing and HTTP caching. This training is delivered by our Symfony expert and contributor instructors, who enjoy sharing their experience, best practices as well as tips and tricks to help you be more efficient and autonomous with Symfony 4.

Full program

Discovering the Symfony 4 Project

  • General overview of the Symfony 4 project (source code, license, documentation, community, philosophy, ecosystem, etc.)
  • Understanding the release cycle of new Symfony versions
  • Bootstrapping a new Symfony 4 application project with Composer and Flex
  • Taming project files and directory structure
  • Installing third party modules (bundles, libraries) with Flex
  • Finding help and documentation resources on the Internet
  • Understanding the HTTP request / response processing workflow
  • Discovering the concept of Symfony environments (development, production and test)
  • Developing code according to Symfony coding and namming conventions
  • Taming the CLI tool and its numerous useful commands

Learning how to Debug Code

  • Installing the « Web Profiler » with Symfony Flex
  • Enabling errors and incidents logging
  • Displaying the « Web Debug Toolbar » on Web pages
  • Browsing the « Web Profiler » debugging panels
  • Analyzing exceptions stack traces and error messages
  • Introspecting a variable contents

Mastering the Configuration Layer

  • Register new routes definitions (YAML and annotations)
  • Constraining routes configuration (HTTP verb, domain name, placeholders, etc.)
  • Overloading third party bundles configuration
  • Declaring new global configuration parameters
  • Extracting sensitive and runtime platform specific global parameters to environment variables
  • Understanding the configuration overloading per environment

Responding to the Client's Request

  • Developing controller classes and actions methods
  • Transforming a request objet into a response object
  • Mapping URLs to controllers with annotations
  • Generating a raw response or from a Twig template
  • Accessing the request objet to read client's data
  • Reading and writing data from/to the user's session
  • Reading and writing data from/to a cookie
  • Generating a 404 response type page
  • Redirecting the user to another page with HTTP redirects

Generating Dynamic Web Pages

  • Discovering the Twig tempate engine
  • Designing concise and explicit templates
  • Accessing Twig templates global variables
  • Mastering the Twig grammar (tags, filters, functions, tests, etc.)
  • Building more advanced Web pages with template inheritance
  • Refactoring duplicated code thanks to template inclusion
  • Performing an action and displaying its result from a view
  • Generating URL patterns based on registered routes
  • Rendering Symfony forms

Interacting with the User thanks to Forms

  • Designing and processing simple forms
  • Applying validation rules to validate submitted data
  • Prototyping the rendering of a form with Twig
  • Gathering validated data from a form
  • Sending an e-mail built from the form submitted data

Internationalizing and Localizing Contents

  • Installing the translation component
  • Changing the default application locale
  • Defining simple translation keys in Twig views
  • Generating translation files skeletons (XLIFF, YAML)
  • Translating keys
  • Handling translation keys including plural sentences

Interacting with a SQL Relational Database

  • Installing and configuring the Doctrine ORM
  • Establishing an object-relational mapping with entity classes
  • Linking entities together thanks to relationships mapping
  • Persisting object entities into the SQL database
  • Building dynamic SQL queries thanks to the Doctrine Query Builder object
  • Extracting entities from the database
  • Hosting custom SQL queries in Doctrine repositories objects
  • Encapsulating entities related domain logic into entity classes

Going Further with Forms

  • Designing and processing forms
  • Rendering configurable forms with the options system
  • Triggering custom specific logic when form events arise
  • Customizing the rendering of a Symfony form with form themes
  • Applying data custom validation logic
  • Triggering validation rules according to the form context

Perpetuating the Application with Automated Tests

  • Discovering the PHPUnit unit testing framework
  • Understanding the pros of automating tests
  • Configuring a unit tests suite
  • Creating and executing a unit tests suite
  • Creating and executing a functional tests suite
  • Generating code coverage report

Outsourcing the Business Logic into Services

  • Understanding the dependency injection principle
  • Introducing the Symfony service container
  • Listing all existing Symfony framework services
  • Registering new business services into the container
  • Configuring services with global parameters
  • Leveraging the services auto-registration mechanism
  • Adapting services configuration manually when needed

Decoupling Code with Event Programming

  • Introduction to the Mediator design pattern and its implementation in Symfony (the Event Dispatcher)
  • Discovering the built-in Symfony kernel events
  • Executing custom code whenever an event occurs in the framwork
  • Propagating custom business events through the service layer
  • Connecting custom event listeners / subscribers on the business code

Securing Access to the Application Protected Pages

  • Introduction to authentication and authorization principles
  • Securing a Web site with a traditional login form authentication
  • Setting up a form authentication system with the Guard component
  • Establishing a security policy based on users' permissions
  • Registering custom authorization rules thanks to voters