ldap_add symfony : server is unwilling to perform
I need to add new entries in a Active Directory on Windows Server 2012 that I have in a Virtual Machine.I'm on a Symfony 4 project using the Ldap Component bundle :...
View ArticleDoctrine doesn't work with static variable
I have a form with some data to enter ( name,date1,date2) and I'm retrieving this data to the function test1.Then, I'm putting this value (name,date1,date2) into static variable. However,I don't know...
View Articleredirect to API Platform Route with preserving the request data
I'm working with Symfony 4.4.2And I'm trying to redirect an URL to an API platform Action, but I lost the JSON data of my original request body.The purpose I made this action is just, to hide the id,...
View ArticleMake a modification in show action in sonata admin bundle using CRUD controller
I want to make a modification in show template of sonata admin: instead of having this link :".../21/show" (where 21 is an id of an item) i want it to be like this ".../21/show?param=$var" where $var...
View ArticleUses cases for doctrine nested transactions
I have a project where I need to do a transaction because I have 3 entities that depend on each other. Tenant, Organization, User.First I started with a single transaction on one of the repositories...
View ArticleThe dynamically modified form field (EntityType) using form events is...
in my form I have 2 field: town and school.I want to dynamically narrow the field school list after change town list.I did so:$form ->add('town', ChoiceType::class, ['label' =>...
View ArticleConsole crash when updating entity in symfony4
I am working on a project on symfony 4, when i try to create entity i got an error1and when i want to update an existing entity, the console doesn't allow me to insert the entity's name and then...
View ArticleUnable to install maker-bundle in Symfony
1) I have Run this command composer require symfony/maker-bundle --dev. And it is not installing maker-bundle.2) I am using Symfony version is 4.4.7.3) But I am getting following errors:Using version...
View ArticleSymfony4 store in session entity with relations
I have a multi step form and need to store my entity in the session.The problem is that the entity have relations and when I retrieve it from Session, the relations attributes are disappearing (null).I...
View Articlesonata admin bundle crud, symfony4
im working in a project with sonata admin bundle (symfony), using its crud to display items, as its knowned there is two default templates, show and edit, in my case i'll use the show and rather than...
View Articlemaker-bundle custom skeleton (symfony 4)
I would like to replace maker-bundle template by my own template skeleton https://github.com/symfony/maker-bundle/tree/master/src/Resources/skeleton/crudIn sensiolabs/SensioGeneratorBundle (SF3) it was...
View ArticleBehat tests with PHPUnit assertions
I had project in symfony 4.3 which uses PHPUnit Bridge 5.0, and I wanna use assert functions in functional tests (behat). In older project I used PHPUnit package and by require_once include this...
View ArticleSymfony 4 - controllers in two directories
In my application, I use Symfony 4. I want Symfony to search for controllers in two directories: A and B. I found something like this:controllers: resource: '../src/DirectoryA/Controller/' type:...
View ArticleHow to get form validation groups defined as closure function which were used...
Based on example presented in doc$resolver->setDefaults(['validation_groups' => function (FormInterface $form) { $data = $form->getData(); if (Client::TYPE_PERSON == $data->getType()) {...
View ArticleSymfony 4 Fixtures relation - Undefined offset: 0
I'm doing a Symfony 4.4 project, and I'm in the process of making fixtures. I've started with a UserFixtures class for my User objects. Then I moved on to PersonFixtures. One of the properties of a...
View ArticleSymfony 4.4 : could not find driver when make:entity relation field but php...
I need to add to my entity Agency, a relation to the Country entity. When I run php bin/console make:entity Agency I can add string fields, int fields, etc... But when I wan to add my country field...
View ArticleHow to use a custom collection in Symfony 4
I want to use a custom collection class for my Symfony 4 application. The following scenario is an example of what I am trying to achieve:I have a post collection class which has some utility for...
View ArticleRoute redirecting in symfony
After i upgrading Symfony from 3.3 to 4.4.7 i'm facing an issue with routing. For example, i'm visiting a url like this abcd.com/secure-admin/subadmin-management it shows the correct page.But if we try...
View ArticleCan't create Symfony 4 projects
i'm working already with symfony 3, I've create a lot of project with it, so now i'm trying to create a project with symfony 4, but i can't when i type this command :composer create-project...
View ArticleUsing Symfony progress bar without knowing the exact number of steps in advance
I have this example of how to use the Symfony progress bar helperprotected function execute(InputInterface $input, OutputInterface $output) { // Fake data source $customers = [ ['John Doe',...
View Article