Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
56 views

I am having a problem today installing the league/csv bundle (v9.27) on my Symfony (v7.2) project with doctrine/orm (v3.3)! When I run command php require league/csv, I get this message: Your ...
69 votes
1 answer
15k views

What does ~ mean in the YML configuration file in Symfony 2? For example: NotBlank: ~
1 vote
3 answers
9k views

I have a variable in PHP $var="<b>#Something#</b>"; and render it via Twig like {{ var }}. I don't want it to render <b>#Something#</b>, but as #Something#. Where am ...
7 votes
5 answers
11k views

I'm trying to validate enum type inside a custom DTO class. I'm trying to use the Symfony #[Assert\Choice] attribute but it seems that it doesn't work if I pass wrong value. Custom DTO: #[Assert\...
4 votes
1 answer
11k views

I am using PHP 8.1.6, Symfony 6 with Doctrine ORM. I've been trying to get it to work for a long time but with no luck. I have followed tutorials but they are usually from other older versions of ...
1 vote
1 answer
1k views

Is it possible to assign required roles for route, where all of the roles are mandatory for granted access? Currently I have something like this: security: access_control: - { path: ^/...
0 votes
2 answers
896 views

In Symfony using doctrine, whats the best way to run a certain function just before an entity is saved/persisted to the database. I only want it to be run once in its lifetime so I guess the ...
22 votes
8 answers
38k views

I am rendering a form with an entity field in symfony. It works well when i choose a regular entity field. $builder ->add('parent','entity',array( 'class' => 'AppBundle:...
2 votes
1 answer
106 views

While upgrading twig v1.30 to v3.22.0 i encountered some problem using macros from an external file and calling them by using a variable value as dynamic name. Given the twig file with the macros: {# ...
Advice
0 votes
3 replies
78 views

I need to add trackability information for all logs. E.g. logged in user and route parameters (entity ID) Right now I have this code: use Monolog\Processor\ProcessorInterface; class RequestProcessor ...
-1 votes
1 answer
67 views

we are implemented a custom controller for one webspace of our sulu 2.6 installation. It requires login against our SSO, but the problem is, that the result is cached. We have 4 Webspaces, just one ...
1 vote
1 answer
617 views

I'm building the Symfony entities from the existing database dump, and decided to switch from Datetime objects to Datatime Immutable, which don't have to change anything in database. But in the ...
1 vote
2 answers
148 views

I am new in Symfony and I am trying to get all the records from my content table. It works but it also returns all the fields from the related entity. $content = $this->contentRepository->...
6 votes
2 answers
9k views

My question is how to configure connection to mysql container. Here is my docker-compose.yml version: '3' services: php: build: ./php-fpm volumes: - ./iym:/var/www/iym - ./...
2 votes
1 answer
57 views

Symfony/Doctrine: PostgreSQL Migration Issue – Undefined column error only in HTTP Kernel (CLI works) I'm working on a Symfony 7.3 project running on PHP 8.2. I recently migrated the database from ...
3 votes
3 answers
4k views

I've initialized a new Symfony project with version 6.3.3 and wanted to try out the symfony-ux stuff with React. So I followed this guide: https://symfony.com/bundles/ux-react/current/index.html But I ...
1 vote
2 answers
11k views

I'm trying to create REST API with JWT authentification in Symfony5. At first I've tried to do as written here https://h-benkachoud.medium.com/symfony-rest-api-without-fosrestbundle-using-jwt-...
0 votes
2 answers
56 views

I'm using a LiveComponent to access a form with a OneToMany collection. Adding an item works perfectly, but when I delete an item, the entire collection is deleted. The code is below. ->add('...
1 vote
3 answers
10k views

I am trying to covert this query db.getCollection('queues').find({ $and:[ {queue: 'testo'}, {$or: [ {$and: [{reserved_at: null}, {available_at:{'$lte':1490323024}}]}, ...
1 vote
1 answer
2k views

Prior to beginning upgrade work to update my application to Symfony 3, and with it upgrading several libraries (including Doctrine) to more recent versions, I was able to compare references in a query ...
15 votes
6 answers
25k views

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 ...
0 votes
1 answer
529 views

I have created an application where I can manage multiple websites. There are a lot of "extensions" (bundles) that can be used in the websites if they have the right to use it. The rights (...
5 votes
1 answer
4k views

There is a table with many columns along with primary key column 'id' having auto increment attribute. The database is mySQL. There are two kinds of PHP code that are inserting in that column. 1.) ...
2 votes
3 answers
19k views

I'm trying to use http://eonasdan.github.io/bootstrap-datetimepicker/ in my Symfony form. I added: <link type="text/css" rel="stylesheet" href="{{ asset('assets/css/bootstrap-datetimepicker-...
1 vote
1 answer
79 views

Using Symfony 7.3, I have this basic security.yaml: form_login: login_path: app_login check_path: app_login enable_csrf: true success_handler: ...
-1 votes
0 answers
37 views

i've installed swiper js with importmap:require swiper in symfony. it download a umd version of the package in the vendor/ Note: i use it in a stimulus controller We cannot import Swiper from "...
4 votes
1 answer
1k views

I'm working with Api Platform, Symfony and Doctrine. I'm expecting a JSON of an object from my frontend, which is essential in procuring the data from my backend. Since GET requests don't/should not ...
0 votes
1 answer
63 views

I’m trying to create a getCollection route using POST with API Platform. The idea is to perform a search that takes a JSON payload to handle search conditions first, and later manage relations, ...
0 votes
2 answers
5k views

I've just started using Symfony. Firstly, I have no database in my small project. However, it forces me to use DATABASE_URL. So, I have to create a database. When I do this, the project works. Do I ...
24 votes
6 answers
28k views

I am having a hard time finding the correct result for this. I have one to one mapping. There are two tables: /** * @ORM\Table(name="users") * @ORM\Entity */ class Users { /** * @ORM\...
2 votes
1 answer
9k views

I know it is easy to check if a variable is defined using {# defined works with variable names #} {% if foo is defined %} ... {% endif %} and to set a variable if it is undefined using: {% set ...
0 votes
0 answers
76 views

I have a menu that is using Live Components that shows, loads more, and filters through a list of brands. It shows a list of brands with checkbox for each, that acts as a filtering option on the page. ...
2 votes
3 answers
17k views

Via an XML import I'm getting also an url link to jpg images on an external server. I want to copy the images. I'm tried to do this via UploadedFile() function in Symfony to then add them in my entity....
-1 votes
2 answers
3k views

I am trying to set up a development environment with Symfony running in Docker. Recently I installed the symfony/mailer package with the option to install a mailcatcher, which turned out to be axllent/...
2 votes
1 answer
5k views

If I prepare a response in my controller like so: $response = new Response(); $response->setContent($this->render('mytemplate.html.twig'); $response->send(); Rather than using: return $this-&...
3 votes
1 answer
7k views

I've been asked by a client to look into Symfony UX's Live Components for use in an internal project. We/they are away of its alpha status and the fact that it will likely change and break over time ...
2 votes
1 answer
104 views

I would like to have multiple markers on the same map with Symfony and UX Map! I've read the documentation but can't find the solution there! At the moment, I can get all the markers but on different ...
2 votes
1 answer
128 views

In my symfony project I have this configuration upon messenger.yaml: framework: messenger: transports: async: '%env(MESSENGER_TRANSPORT_DSN)%' failed: 'doctrine://...
10 votes
2 answers
2k views

I am working on a Symfony REST API project and trying to update the framework and all my dependencies to the latest version. I recently moved to PHP 8.3 and am trying to embrace the new PHP attributes ...
0 votes
1 answer
217 views

I'm working on my second Symfony project and trying to follow best practices. I've switched from static methods to services for improved readability and potential performance gains. For instance, I ...
0 votes
2 answers
682 views

I'm using PHP8 attributes to flag Doctrine entities in a Symfony project, to set the entity up for audit logging. To determine whether the entity should be audited I would check whether it has an #[...
0 votes
2 answers
2k views

I have everything working correctly and now I'm trying to work with form themes. This is my code to generate the form without a theme. {% extends 'base.html.twig' %} {% block body %} {% include 'menu/...
2 votes
0 answers
45 views

I use Symfony 6 with EasyAdmin, I've been trying for several hours to understand how form types work in Symfony, and more specifically how to set up a custom form field, but I can't find a simple, ...
2 votes
1 answer
173 views

When trying to do a "composer upgrade", it fails in "@auto-scripts" when reaching doctrine/doctrine-bundle. The error is: Executing script cache:clear [KO] [KO] Script cache:clear ...
3 votes
2 answers
11k views

I have a Symfony3 project on my localhost (Windows 7 Entreprise) and I use Wamp Server 3.0.0 with PHP 5.6.16 and Apache 2.4.17. When I do : php bin/console cache:clear I have this error : I also ...
5 votes
2 answers
3k views

As it can be read in the official documentation, the current procedure to manually hash a password in the Symfony framework, is the following: use Symfony\Component\Security\Core\Encoder\...
6 votes
1 answer
2k views

Currently using the Postman REST client to debug my ajax calls, I would like to know if there a way to show the response content of an ajax response inside the Symfony profiler ? I can only seem to ...
3 votes
1 answer
2k views

Everyone on the internet seems to understand that http response codes have a certain 'description' or 'message'. For example, 404 has the description "Not Found". So I would expect ...
1 vote
3 answers
4k views

In my Symfony 4.4 project I want to add specific method every time I trigger setSomething() setter method, but perhaps I can use traits? Can traits have services injected?
9 votes
5 answers
15k views

Ive been just starting to learn Symfony PHP framework, and Ive run into some problems with its configuration. When trying to create a new project with command line like so: symfony new --full ...

1
2 3 4 5
1485