Top "Symfony4" questions

Symfony is a PHP framework developed by SensioLabs.

symfony 4 : How to get "/public" from RootDir

I have an image under the public folder. How can I get my image directory in symfony4 ? In symfony 3, it's …

symfony symfony4
How to fix "https://repo.packagist.org/packages.json does not contain valid Json"?

I've an issue with composer running on a vagrantbox (Centos 7), which started to just suddenly happen. I've already tried manually …

composer-php vagrant symfony4
Cannot autowire service: Argument references class but no such service exists

I'm upgrading a project from Symfony 3 to Symfony 4 (https://github.com/symfony/symfony/blob/master/UPGRADE-4.0.md) and I have …

php symfony doctrine symfony4
Symfony 4, get the root path of the project from a custom class (not a controller class)

In the src/Utils directory, I created a custom class Foo for various things. I'm looking for a way to …

php symfony4
Symfony Error: "An exception has been thrown during the rendering of a template"

I am trying to include <link href="{{ asset('css/mystyle.css') }}" rel="stylesheet"/> in my twig file and …

php symfony twig rendering symfony4
Symfony 4 - Set DateTime

so I've been following this Database and the Doctrine tutorial: https://symfony.com/doc/current/doctrine.html the only difference …

symfony datetime symfony4
Including Assets (CSS, JS) in Symfony 4 / Twig Template

Im learning Symfony and trying to set up a boilerplate app in Symfony 4 This Symfony document describes how to include …

php css symfony twig symfony4
Generating CRUD in symfony 4

After releasing Symfony 4.0, there is no support for SensioGeneratorBundle. hence the command php app/console generate:doctrine:crud is not …

crud symfony4
Allow CORS on symfony 4

I recently needed to allow CORS and on my search for a solution I found nelmio/NelmioCorsBundle. For the begging …

php symfony symfony4 nelmiocorsbundle
Using an environment variable (from `.env` file) in custom Twig function in Symfony 4

How can I use an environment variable from the .env file in a custom Twig function (\Twig_SimpleFunction) in Symfony 4?

twig environment-variables symfony4 twig-extension