How to Test a Form with Multiple Submit
I have a form with 2 submit// src/Form/FooType.php$builder ->add('mainsubmit', SubmitType::class, []) ->add('extrasubmit', SubmitType::class, [])In my controller, I do some different treatment...
View ArticleSymfony 4 - encrypt/decrypt fields used in doctrine with a Service?
So I have fields in my database in an entity class Person{ // other fields /** * @var string * * @ORM\Column(name="last_name", type="string", length=50, nullable=false) */ private $lastName; /** * @var...
View ArticleSymfony 4.0.0 Services argument wiring error
I am making a ProductBundle based on FOSUserbundle, but I'm having trouble with the autowiring of service arguments to the FormFactory and ProductManager classes.I keep getting the error: Cannot...
View ArticleHow to add image in the twig template?
It start getting bit annoying now. My images are inside public/images/ folder. I am trying to add an image to the my TemplatedEmailIn my twig template, I have tried everything I found in the...
View ArticleHow do I compare the date from the user with the date in the database in...
I use Symfony 4. When I compare date I can only compare years as below, not days or months. If it is in different months and days in the same year, it shows equal to each other. I want to compare days,...
View ArticleSet custom port when starting symfony local web server
I want to start a server with symfony server:start using the port that is set in my .env file. Is there a way to do this?
View Article"Connection refused" while trying to connect to docker mysql container
How do I configure a connection to a MySQL container?Here is my docker-compose.ymlversion: '3'services:php: build: ./php-fpm volumes: - ./iym:/var/www/iym - ./php-fpm/php.ini:/usr/local/etc/php/php.ini...
View ArticleParse error: syntax error, unexpected '|', expecting variable (T_VARIABLE)...
I have some syntax errors from symfony vendor when i'm trying to composer install my project.Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE)...
View ArticleHow to exclude deprecation messages from logs in Symfony 4?
I have migrated an application from Symfony 3.4 to Symfony 4.4.Now I have a lot of deprecations for each request/ Sf command (I can't fix that deprecations).How can I exclude deprecations from the log...
View ArticleMore than one application per project repository with Symfony 4
I have three old applications (running on Symfony 2) where each one has been developed in separated git repositories and configured in their respective vhosts:company.com Company...
View ArticleSymfony Authenticator doesn't Authenticate properly (Authenticator doesn't...
Recently I was stuck in a bug and I have no idea why it doesn't work I hope u guys have an idea.So the point is I wanna create a login for my admin so I create it entity \App\Entity\Admin, controller...
View ArticleHow to load a custom config file in a Bundleless application with Treebuilder?
I'm trying to import a custom config file called test.yaml.I put the test.yaml in the config/packages/local folder and in config/packages folder.The test.yaml file looks like this:#...
View ArticleSerialization of 'Symfony\Component\HttpFoundation\File\File' is not allowed,...
I've added an avatar image to my User class. When I wanted to render my edit form, I got this errorSerialization of 'Symfony\Component\HttpFoundation\File\File' is not allowedI tried to solve the...
View ArticleThere is no extension able to load the configuration for "sentry"
I have this error in my symfony 4 project :There is no extension able to load the configuration for "sentry" (in C:\SourceGit\Sentry\taxeapprentissage\config/packages/sentry.yaml). Looked for namespace...
View ArticleHow to enable profiler in symfony 4
Solved:I re-install it all over again and now it contains the web_profiler.yalm inside. Thanks to all.The original question was:I´m just starting to learn Symfony so I downloaded the free videos at...
View ArticleSymfony PHPUnit - Inject dependency
I want to test this TokenProvider<?phpdeclare(strict_types=1);namespace App\Services\Provider;use App\Repository\UserRepository;use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;use...
View Articlesymfony 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 equivalent is :$webPath = $this->get('kernel')->getRootDir() . '/../web/';
View ArticleEasyadmin : display tooltip in index page
Is there anyway to add tooltip functionality to easyadmin 'index' page?In documentation, the sethelp function can be used only in the 'detail', 'edit' and 'new' pages.
View ArticleHow to get .env parameter from a controller?
From symfony 4, I want create a global parameter and get the value of this parameter from a controller. This parameter is the path of an another app in the server. So, I thinked add the paramerter in...
View ArticleHow can I make a symfony 4 command to be registered only in dev environment...
In my App I have a helper class App\Command\GenerateFixturesCommand that provides a command named my-nice-project:generate-fixtures.This command consumes a service of my own project named...
View Article