Skip to content

Instantly share code, notes, and snippets.

@tattali
Last active May 20, 2018
Embed
What would you like to do?

Symfony 4

Framework download and install

Install Symfony 4 skeleton

composer create-project symfony/skeleton my-project && cd my-project

Use git to versionize your project

git init
git add .
git commit -m "Initial commit with sf4"

Required packages with details

Install dev packages :

  • sec-checker : check on each package installation if the package contains vulnerabilities
  • profiler : Add Symfony dev bar
  • server : Virtual web server command line tool
composer require --dev sec-checker profiler server

Install required CRUD packages to fill up best practices :

  • annotations : To use annotation routes
  • twig : Templating engine
  • asset : To link assets from public/ folder
  • translator : Allow translations in the project
  • form : Add symfony form component
  • doctrine : ORM to manage the database
  • validator : Add form validations (Assert)
composer require annotations twig asset translator form doctrine validator

Optionnal

Use doctrine fixture bundle to add fake data

composer require --dev doctrine/doctrine-fixtures-bundle

Install maker to use symfony generator

composer require maker

For firewall configuration

composer require security

Finally save

git add .
git commit -m "Basis packages"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment