Why after upgrading to Symfony 4.4 I no longer get the error preview pages?
I've just updated a project from Symfony 4.3 to 4.4. After the update when I have an error the page shown is the production error page with the "Oops! An Error Occurred!", not the dev error page with...
View ArticleHow to filter annotation for Many To Many on an API platform
I've follow the implementation of filters with annotation to load only the sources concern for one user. Very usefull, work...
View ArticleHow to force locale after setLocale is deprecated?
I need to render documents in different languages. Therefore I used to use the following code:use...
View ArticleUse integer for relation
I'm implementing a REST API, and I would like to implement a quick and easy way to create and persist entities.Therefore, I created an entity like so, where $plain is a basic associative array: public...
View ArticleAutowire request body to controller
I'm searching for a clean and simple way to autowire a POST request's body as a controller action argument, and deserialize it at the same time if application/json is set.I've looked at events or...
View ArticlePrevent exceptions from being displayed on the terminal in Symfony 4.4
I'm working on a Symfony 4.4 console command and I want to prevent exceptions from being displayed on the terminal. I've already set up a logger to log the exceptions, but they still appear on the...
View ArticleTemplate is showing only in html
I have a problem with rendering a page with expanding in base template it only shows in html with no css or js.This is what is shows:imgI'm trying to understand the problem and it seems illogical cause...
View ArticleHow to embed images in a symfony mail?
So I designed an email template for my reset-password system.In the email templates, there are Images (logo).I placed those images inside a folder called Email_Images and that folder is placed inside...
View ArticleSymfony 4 Flex Database connection using `urlencode`
I am starting a new project using Symfony 4 + Flex. At this time I'm trying to connect my new app to a MySQL database.I'm following the Symfony Documentation, and I have already add doctrine to my...
View Articlefind replacement for abandoned servocoder/richfilemanager-php
Package has been abandoned, updating citco/carbon and nesbot/carbon to '^2.0' requires illuminate/support '^6.20' and illuminate/config '^6.20' but servocoder/richfilemanager-php only supports up to...
View ArticleHow to implement the view layer for a custom Akeneo PIM bundle?
I'm writing a (Symfony 4) bundle for Akeneo PIM Community Edition v5.It's supposed to retrieve product stock data from an external instance (via REST API) and to display this data in the products list...
View ArticleHow to add placeholder on input in Symfony 4 form?
In my Symfony 4 form, I am try to get a placeholder for my input. I tried the below but I get an error that it is not allowed. Any ideas how else I can achieve this?$builder->add('firstname',...
View ArticleSymfony 6.4 multiple connections, update not always working
I'm using Symfony 6.4 with multiple connections.I have 2 databases (P2223 and P2324) with the same datatables struct, but with different data.My...
View ArticleHow to add placeholder on an input in Symfony 4 form?
In a Symfony 4 form, I am trying to get a placeholder on my input. I tried the code below, but I get an error telling me it's not allowed. Any ideas how else I can achieve...
View ArticleOPTIONS request gets a "401 Unauthorized" response
I crafted an API with Symfony 4 that uses a custom token verification. I tested the API on Postman and everything works perfectly, now I want to use the API using jQuery and fetch all the data , but 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 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 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 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 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 Article