Read environment variable from .env in Symfony (4, 5) controller [2021]

preview_player
Показать описание
This tutorial describes in 3 easy and quick steps how to read environment variable from .env file into Symfony controller.
This works on Symfony 4 and 5.
Steps are as follows:
1. Add Key Value pair in .env file
3 Read in controller using getParameter() method.

This tutorial is Video version of same tutorial on my blog if you want to read and look at code structure, here is the link

#Symfony #Symfony4 #Symfony5
Рекомендации по теме
Комментарии
Автор

Easier, 1s step, and after that use $_ENV['variable']

darkkidy