Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all 3916 articles
Browse latest View live

API Platform : Best way to custom logic for a GET route

$
0
0

I'm new do API PLatform and i don't understand how to do some things.

For some reason, I have a Journal entity with a Content field (text).

In this Content field, I have a chain of Post (Entity) Ids, separated by a "|".

For exemple : "123|256|23|456|894|356|2|1646|998|61|9898|16|665|65|" and so on.

When we request the "/api/journal/1" route with an User ID as parameter, I want to parse the Content Field of the Journal Entity and return all the matching Posts in the right order.

It's not a standard behaviour and i'm very confused when i read the documentation.

Can someone explain to me how i can do this ?

Thanks a lot !


Image preview with Symfony 4 and SonataAdmin

$
0
0

I want to show an uploaded image preview on my sonata form. The image is related to an other entity.

I've succeeded to upload the image and to get his filename in the view list. But now I would like to have a preview of that image shown as well in the list view and in the form view.

This is what I have (simplified version)

ForumAdmin with the file upload system

class ForumAdmin extends AbstractAdmin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper->add('name', TextType::class);
        $formMapper->add('description', TextAreaType::class);
        $formMapper->add('weight', IntegerType::class);
        $formMapper->add('category', EntityType::class, [
            'class' => Category::class,
            'choice_label' => 'name',
        ]);
        $formMapper->add('file', FileType::class, array('required' => false));
    }

    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper->add('name');
        $datagridMapper->add('category');
    }

    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper->addIdentifier('imageName');
    }


  public function preUpdate($forum){
    $this->saveFile($forum);
  }

  public function saveFile($forum) {
    $basepath = $this->getRequest()->getBasePath();
    $forum->upload($basepath);
  }

}

ImageAdmin

final class ImageAdmin extends AbstractAdmin
{
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('image', FileType::class);
    }

    public function prePersist($image)
    {
        $this->manageFileUpload($image);
    }

    public function preUpdate($image)
    {
        $this->manageFileUpload($image);
    }

    private function manageFileUpload($image)
    {
        if ($image->getFile()) {
            $image->refreshUpdated();
        }
    }
}

I was searching about may be trying to override sonata template, but I don't think this is how to do. I also have been reading the documentation here but either I don't understand either I can't make it work.

Thanks for your help

Symfony 4 EasyAdmin Bundle Create Entities Linked by a ManyToMany Relationship

$
0
0

Bonjour, Je travail sur un petit projet de gestion des bulletins de salaires d'une petite boîte avec Symfony4 et j'utilise easyAdmin en tant que débutant. J'ai trois classes (Employe, Lot et Bulletin) liées par des relations ManyToOne - OneToMany pour dire qu'un employé a plusieurs bulletins, un lot a plusieurs bulletin et un bulletin appartient à un seul lot et à un seul employé : La classe Employé :

<?php

class Employe
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;
      /**
     * @ORM\Column(type="string", length=255)
     */
    private $fullName;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Bulletin", mappedBy="employe", orphanRemoval=true)
     */
    private $bulletins;

    public function __construct()
    {
        $this->elements = new ArrayCollection();
        $this->liaisons = new ArrayCollection();
        $this->bulletins = new ArrayCollection();
    }
    /**
     * @return Collection|Bulletin[]
     */
    public function getBulletins(): Collection
    {
        return $this->bulletins;
    }

    public function addBulletin(Bulletin $bulletin): self
    {
        if (!$this->bulletins->contains($bulletin)) {
            $this->bulletins[] = $bulletin;
            $bulletin->setEmploye($this);
        }

        return $this;
    }

    public function removeBulletin(Bulletin $bulletin): self
    {
        if ($this->bulletins->contains($bulletin)) {
            $this->bulletins->removeElement($bulletin);
            // set the owning side to null (unless already changed)
            if ($bulletin->getEmploye() === $this) {
                $bulletin->setEmploye(null);
            }
        }

        return $this;
    }
    // getters and setters
}

//La classe Lot :

class Lot
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=120)
     */
    private $libelle;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Bulletin", mappedBy="lot", orphanRemoval=true, cascade={"persist"})
     */
    private $bulletins;

    public function __construct()
    {
        $this->bulletins = new ArrayCollection();

    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getLibelle(): ?string
    {
        return $this->libelle;
    }

    public function setLibelle(string $libelle): self
    {
        $this->libelle = $libelle;

        return $this;
    }
    /**
     * @return Collection|Bulletin[]
     */
    public function getBulletins(): Collection
    {
        return $this->bulletins;
    }

    public function addBulletin(Bulletin $bulletin): self
    {
        if (!$this->bulletins->contains($bulletin)) {
            $this->bulletins[] = $bulletin;
            $bulletin->setLot($this);
        }

        return $this;
    }

    public function removeBulletin(Bulletin $bulletin): self
    {
        if ($this->bulletins->contains($bulletin)) {
            $this->bulletins->removeElement($bulletin);
            // set the owning side to null (unless already changed)
            if ($bulletin->getLot() === $this) {
                $bulletin->setLot(null);
            }
        }

        return $this;
    }

    public function __toString(){

        return $this->libelle;
    }
}


//La classe bulletin

class Bulletin
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Employe", inversedBy="bulletins")
     * @ORM\JoinColumn(nullable=false)
     */
    private $employe;

    /**
     * @ORM\ManyToOne(targetEntity="App\Entity\Lot", inversedBy="bulletins",cascade={"persist"})
     * @ORM\JoinColumn(nullable=false)
     */
    private $lot;

    /**
     * @ORM\OneToMany(targetEntity="App\Entity\Figurer", mappedBy="bulletin", orphanRemoval=true)
     */
    private $figurations;

    public function __construct()
    {
        $this->figurations = new ArrayCollection();
    }

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getEmploye(): ?Employe
    {
        return $this->employe;
    }

    public function setEmploye(?Employe $employe): self
    {
        $this->employe = $employe;

        return $this;
    }

    public function getLot(): ?Lot
    {
        return $this->lot;
    }

    public function setLot(?Lot $lot): self
    {
        $this->lot = $lot;

        return $this;
    }

    /**
     * @return Collection|Figurer[]
     */
    public function getFigurations(): Collection
    {
        return $this->figurations;
    }

    public function addFiguration(Figurer $figuration): self
    {
        if (!$this->figurations->contains($figuration)) {
            $this->figurations[] = $figuration;
            $figuration->setBulletin($this);
        }

        return $this;
    }

    public function removeFiguration(Figurer $figuration): self
    {
        if ($this->figurations->contains($figuration)) {
            $this->figurations->removeElement($figuration);
            // set the owning side to null (unless already changed)
            if ($figuration->getBulletin() === $this) {
                $figuration->setBulletin(null);
            }
        }

        return $this;
    }

    public function __toString(){

        return $this->employe->getId().''.$this->employe->getPrenom().''.$this->employe->getNom();
    }
}

Je voudrais maintenant que lors de la création d'un Lot avec EasyAdmin qu'un Bulletin soit généré pour chaque employé et enregistré dans la base de données. exemple si j'ai 5 employés dans ma base de données, lors de la création d'un lot de bulletin, 5 bulletins contenant le même objet Lot + un objet employé dans la liste des 5 soient créés de façon automatique.

Ce que j'ai fait :

J'ai créé un Controller LotController qui étend la classe EasyAdminController et que j'appelle comme controller de base dans mon easy_admin.yml

Code :

Easy_admin.yml

Lot: class: App\Entity\Lot controller: App\Controller\LotController

LotController.php

<?php

namespace App\Controller;

use App\Entity\Employe;
use App\Entity\Bulletin;
use EasyCorp\Bundle\EasyAdminBundle\Controller\EasyAdminController;

class LotController extends EasyAdminController
{
    public function persistEntity($entity)
    {

        $entityManager = $this->getDoctrine()->getManager();

        $employes =  $this->getDoctrine()
        ->getRepository(Employe::class)
        ->findAll();

        $bulletin = new Bulletin();

        $bulletin->setLot($entity);

        foreach($employes as $employe) {

            $bulletin->setEmploye($employe);
            $entityManager->persist($bulletin);
            $entityManager->flush();
        }

        parent::persistEntity($entity);   
    }
}

Mais quand j'enregistre un lot seule le bulletin du dernier employé de ma base de données et généré et je ne sais pas pourquoi les premiers sont omis ?

Si vous pouvez m'aidez... Merci d'avance !

Deploying a symfony 4 project to digital ocean

$
0
0

I'm new to deploying frameworks and I've been reading on Symfony's site to understand how to deploy a project to my production server. I found that it gives information but not for someone who's new to the process (I feel like these documents are written for people who know, but not for people who are learning).

The process I've created was once a github repo is updated, it will push the files to the server (using deployhq.com) and immediately I change the .env file to ensure APP_ENV=prod APP_DEBUG=false are placed.

Then after pushing all of the files to the server, I then run the SSH command of

cd /var/www/projectfolder/ <-- move to the directory of the project
bin/console make:migration <--- set up migrations
bin/console doctrine:migrations:migrate <-- run migration
bin/console cache:clear <-- clear cache

Although after this, I know I still need to build the application. Currently I leave the /public/build folder intact, but I know that's not the right way of doing it. How do I enable the build after all of the SSH commands go through? Also is that all it takes for the process to take hold? What am I missing, or what can I do to make things more efficient?

symfony server:start command throwing an error

$
0
0

I try to run

symfony server:start

It returns an error message

The local web server is already running for this project at port 8000

But lsof -wni tcp:8000 isn't returning anything, I'm sure there isn't any softwares using the port 8000.

Starting by doing

bin/console server:start

is working like a charm.

EasyAdminBundle - List of users by role and group

$
0
0

I am trying to use EasyAdminBundle (https://github.com/EasyCorp/EasyAdminBundle) to manage the admin part of my project.

I am currently doing the list of users, it works very well. I get the list of all existing users

However, users are all assigned in groups and in these groups there are "supervisors". What I would like to do is that these "ROLE_SUPERVISOR", is access to the users administration page but that they can only see the users of the same group.

To summarize what I want: - Me (ROLE_SUPER_ADMIN): I want to see all existing users - ROLE_SUPERVISOR: See all users in the same group as them.

Is this possible?

My EasyAdminBundle configuration file :

easy_admin:
  site_name: '<img height="65px" src="../img/logo.png" />'
  user:
    display_name: true
    name_property_path: 'username'
    display_avatar: false
  design:
    brand_color: '#7C1AE8'
    menu:
      - { entity: 'User', css_class: 'menu--user', icon: 'user', role: [ROLE_SUPERVISEUR, ROLE_SUPER_ADMIN] }
  entities:
    User:
      class: App\Entity\User
      label: 'Utilisateurs'
      list:
        title: "Liste des utilisateurs"
        fields:
          - email
          - { property: 'username', label: "Nom d'utilisateur" }
          - { property: 'group.name', label: "Groupe" }
          - { property: 'lastLogin', label: "Dernière connexion", format: 'd/m/Y H:i:s', type: 'datetime' }
        sort: 'group.name'

CKEditor doesn't save content and adds extra (Symfony4)

$
0
0

I have CKEditor in Symfony4 and it is configured in fos_ckeditor.yaml. When I click on pencil once, it adds

tags. When I click on pencil twice, it removes all content. I want content to remain the same regardless of the number of clicks. Please, help.

My fos_ckeditor.yaml:

    standard_config:
        basicEntities: false
        htmlEncodeOutput: true
        allowedContent: true
        removeFormatAttributes: false
        removeFormatTags: false
        entities: true
        toolbar: "standard_toolbar"
        extraPlugins: "youtube,timestamp,timestamp2,super_link,ins_my_html,ins_my_banner,imagerotate,oembed"
    big_size_config:
        basicEntities: false
        htmlEncodeOutput: true
        height: 30em
        allowedContent: true
        removeFormatAttributes: false
        removeFormatTags: false
        entities: true
        toolbar: "standard_toolbar"
        extraPlugins: "youtube,timestamp,timestamp2,super_link,ins_my_html,ins_my_banner,imagerotate,oembed"

Symfony 4 autowiring exclude ignores subfolders

$
0
0

Assume following directory structure:

/src
  /DTO
    /Factory
      /Collection

I want to exclude all classes, including classes from subdirectories of /DTO directory

In my services file I do:

services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

    App\:
    resource: '../src/*
    exclude:
      - '../src/DTO/*'

This leads to:

Symfony\Component\DependencyInjection\Exception\RuntimeException : Cannot autowire service App\DTO\Factory\Collection\MyCollection

If this service placed in DTO folder directly - then autowiring works.

Can I specify the exclude expression in any way to include subfolders?


Dynamically set Schema for ORM Entity in Symfony 4

$
0
0

I have an application and its data is stored in MySQL. For security purposes, each user's data is stored in a separate database(schema) on that server. The structure of the tables inside are the same for all users/databases.

I am using Symfony 4. I created a doctrine connection and an Entity for the user's settings (table user_settings). However, I need to be able to use that entity for different schemas(databases)

How can I dynamically set the database in runtime for the EntityManager ?

I want to clarify that the number of databases (users) is unknown, so I can not pre-set all of the possible DBs in my config.

How can i configure enqueue/enqueue-bundle/enqueue/amqp-ext to create queue and exchange

$
0
0

Im working with symfony 4.3, I have a problem with enqueue/enqueue-bundle and enqueue/amqp-ext implementation. I always work with php-amqplib/rabbitmq-bundle, I use config file to create queue, exchange and binding ...

old_sound_rabbit_mq:
    connections:
        default:
            host:               "%rabbitmq_default_host%"
            port:               "%rabbitmq_default_port%"
            user:               "%rabbitmq_default_user%"
            password:           "%rabbitmq_default_password%"
            vhost:              "%rabbitmq_default_vhost%"
            lazy:               "%rabbitmq_default_lazy%"
            connection_timeout: "%rabbitmq_default_connection_timeout%"
            read_write_timeout: "%rabbitmq_default_read_write_timeout%"
            keepalive: "%rabbitmq_default_keepalive%"
            heartbeat: "%rabbitmq_default_heartbeat%"
    producers:
        sync_data:
            connection:       default
            exchange_options: {name: "my_exchange", type: topic}
    consumers:
        sync_data:
            connection:       default
            exchange_options: {name: "my_exchange", type: topic}
            queue_options:    {name: "my_queue", routing_keys: {'my.binding.#'}}

When i launch the consumer with old_sound_rabbit_mq, it will automatically create an exchange my_exchange with topic type, and it will also create my_queue with binding key my.binding.# I want to make the same thing with enqueue-bundle, Can i do this ?

When wrong url is entered, exception error encountered

$
0
0

I created a new symphony project trying to work on following.

friendsofsymfony/rest-bundle

Now, at the fos_rest.yml file I added following line of code.

fos_rest:
  format_listener:
    rules:
      - { path: '^/', priorities: ['json'], fallback_format: json }
  view:
    view_response_listener: 'force'
    formats:
      json: true
  exception:
    enabled: true

Now if I try to enter the wrong URL then I am getting following error:

Argument 1 passed to FOS\RestBundle\Controller\ExceptionController::getStatusCode() must be an instance of Exception, instance of Symfony\Component\ErrorHandler\Exception\FlattenException given, called in C:\xampp\htdocs\symfony_rest\vendor\friendsofsymfony\rest-bundle\Controller\ExceptionController.php on line 68

Can anybody help me sort this problem.

Thank You.

How to submit and validate a multipart/form-data form with a file upload in Symfony 4?

$
0
0

I am trying to upload a file via axios/ajax. I am uploading the file like so:

const formData = new FormData();
formData.append('logoFile', e.files[0]);

axios.post('/startups/logo', formData, {
  headers: {
    'Content-Type': 'multipart/form-data',
  },
})

Then on Symfony 4, I want to hydrate my entity and validate the form created with formType:

My formType:

class LogoType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        // Remember username is email
        $builder
            ->add('logoFile', VichFileType::class, [
                'label'         => false,
                'required'      => false,
                'allow_delete'  => false,
                'download_uri'  => true,
                'download_label' => true,
                'download_link' => true,
            ])
        ;
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'csrf_protection' => false,
        ));
    }
}

But in my controller, I can never validate the form:

public function updateLogo(Request $request): Response
{

    $image = $request->files->get('logoFile');

    if(!$image instanceof UploadedFile) {
        throw new HttpException(400, "Cannot find a file to upload. Try again.");
    }
    //$image is now an instance of Symfony\Component\HttpFoundation\File\UploadedFile
    // THIS WORKS ^^ dd($image) does show the file properly

    $logo = new Logo();
    $form = $this->createForm(LogoType::class, $logo);
    $form->submit($request->files->all());

    if ($form->isSubmitted() && $form->isValid()) {
      // THIS PART NEVER GETS HIT.
    }

Note that trying to do $form->handleRequest($request); doesn't work nor does $form->submit($request->request->all()); which is normally the way to go to validate forms submitted via ajax.

Does anyone know how to validate a form that has a file set with multipart/form-data ?

Thank you all.

Doctrine Relationship not with Primary key

$
0
0

What I would like is to create a relationship OneToMany on 2 symfony entities on a specific value (Not on the ID).

This is what I tried:

    class ClassA
    {
        ...

        /**
         * @ORM\ManyToOne(targetEntity="App\Entity\ClassB", inversedBy="list")
         * @ORM\JoinColumn(referencedColumnName="key_id")
         */
        private $classB;
    }

    class ClassB
    {
        ...

        /**
         * @ORM\OneToMany(targetEntity="App\Entity\classA", mappedBy="classB")
         */
        private $list;

        /**
         * @ORM\Column(type="integer")
        */
        private $keyId;
   }

This is my migration :

    $this->addSql('ALTER TABLE class_a ADD CONSTRAINT FK_D4FDD1F49D16CBF9 FOREIGN KEY (class_b_id) REFERENCES class_b (key_id)');

For me that's look right. as the migration say the reference in class_b is key_id

But I get this issue message:

An exception occurred while executing 'ALTER TABLE class_a ADD CONSTRAINT FK_D4FDD1F49D16CBF9 FOREIGN KEY (class_b_id) REFERENCES class_b (keyId)':
SQLSTATE[HY000]: General error: 3734 Failed to add the foreign key constraint. Missing column 'key_id' for constraint 'FK_D4FDD1F49D16CBF9' in the referenced table 'class_b'

What do I made wrong? What do I missed in the documentation?

Thank you for your help

Edit 1:

@spirit Thank you, I thing it's better with a bigInt. But that's change nothing...

$this->addSql('CREATE TABLE class_b (id INT AUTO_INCREMENT NOT NULL, key_id BIGINT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
    $this->addSql('ALTER TABLE class_a ADD CONSTRAINT FK_D4FDD1F49D16CBF9 FOREIGN KEY (class_b_id) REFERENCES class_b (key_id)');

enter image description here

Why does Doctrine tries to insert new entities through relationships?

$
0
0

I have the following Doctrine entities:

<?php

class EntityA
{
    /**
     * @ORM\ManyToOne(targetEntity="EntityB" , inversedBy="propertyA")
     */
    private $propertyB;

    // ....
}

class EntityB
{
    /**
     * @ORM\OneToMany(targetEntity="EntityB", mappedBy="propertyB")
     */
    private $propertyA;

    // ....
}

In this case EntityA is the owning side. Then I am trying to persist an EntityA object:

$entBRef = $em->getRepository(EntityB::class)->find($entityBId);

$ent = new EntityA()->setEntityB($entBRef);
$em->persist($ent);
$em->flush();

But I've got the following error:

A new entity was found through the relationship 'EntityA#propertyB' that was not configured to cascade persist operations for entity: EntityB. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade

What I have done so far?

  1. Read a lot of post here on SO leading to the same solution add cascade={"persist"} to the owning side which I did and I must say did not work.
  2. Read Doctrine docs looking for mistakes on my entities definition but so far everything looks fine to me.

I did found this which is helpful but I keep questioning myself why would Doctrine tries to insert and existent entity just because of the reference? Is there any way to get this working?

I do not want the EntityB persisted nor updated, it already exists. I do want the new EntityA have a FK to an existent record in EntityB.

Symfony 4 : Delete all cache items which begin with something

$
0
0

In Symfony 4, I constructed cache elements dynamically:

$cache = new FilesystemAdapter();
$article = $cache->get('article_' . $code, function (ItemInterface $item) use ($code) {
     $item->expiresAfter(864000);

     return $this->getArticle($code);
});

I want on certain actions to be able to delete all cache items which begin with "article_". Is that possible or do I have to know all the codes I used to delete those cache items?


Symfony 4 handleRequest run a query

$
0
0

I need help to understand why the $form->handleRequest($request); is running some query. I did not find anything about that in the doc.

here is the code that I have simplified as much as possible by removing all unneccessary line and this code is running queries:

 /**
     * @Route("/password/reset/confirm/{token}", name="app_user_password_reset_confirm")
     * @param Request $request
     * @param UserPasswordEncoderInterface $passwordEncoder
     * @param string $token
     * @return Response
     * @throws \Exception 
     */
    public function passwordResetConfirm (Request $request, UserPasswordEncoderInterface $passwordEncoder, string $token) : Response
    {   
        // token cannot be empty. If so exception is thrown
        $user = $this->userRepository->findOneBy(['resetRequestToken' => $token]);

        $form = $this->createForm(ResetPasswordFormType::class, $user);
        $form->handleRequest($request);


        return $this->render('security/resetPassword.html.twig', [
            'form' => $form->createView(),
        ]);
    }


ìn the debugger I can see the query I want, and the query launch by the handleRequest:

SELECT 
t0.id AS id_1, 
t0.username AS username_2, 
t0.roles AS roles_3, 
t0.password AS password_4, 
t0.email AS email_5, 
t0.reset_request_token AS reset_request_token_6, 
t0.reset_request_token_valid_until AS reset_request_token_valid_until_7, t0.email_address_validation_token AS email_address_validation_token_8, 
t0.email_address_validated_at AS email_address_validated_at_9, 
t0.created_at AS created_at_10, 
t0.updated_at AS updated_at_11 
FROM user t0 
WHERE t0.reset_request_token = 'EOhj0rPG5ffkVTlqO6mDwjThwPEee8nA_Ki8a3TCAa8' 
LIMIT 1;

SELECT 
t0.id AS id_1, 
t0.username AS username_2, 
t0.roles AS roles_3, 
t0.password AS password_4, 
t0.email AS email_5, 
t0.reset_request_token AS reset_request_token_6, 
t0.reset_request_token_valid_until AS reset_request_token_valid_until_7, t0.email_address_validation_token AS email_address_validation_token_8, 
t0.email_address_validated_at AS email_address_validated_at_9, 
t0.created_at AS created_at_10, 
t0.updated_at AS updated_at_11 
FROM user t0 
WHERE t0.username = 'Dudu2020';

and both queries are referring the the same entry in the database

id_1 : 17
username_2 : Dudu2020
roles_3 : []
password_4 : $2y$13$3STnGc.PQdqdXgPDIw9EKej9A.u9DV5TH7S6TPoLynn...
email_5 : mail@mail.com
reset_request_token_6 : EOhj0rPG5ffkVTlqO6mDwjThwPEee8nA_Ki8a3TCAa8

How do I know that is coming form the handleRequest? because if I remove it, the second query disappear

I even tried to change first query the parameter to username as the second query do.

Does anybody have a clue to help me to understand?

How to resolve 404 url not found on amazon aws ,symfony 4 project

$
0
0

I have deployed my symfony 4 website on amazon aws. When i am trying to access homepage of the deployed website i can access it but when i am trying to access other routes/webpages like /contactus . I am getting this error :


Not Found
The requested URL was not found on this server.

I have setup test enviroment in .env file of the symfony 4 project

How can resolve this issue ?

Select one Secteur and then get all groupements belong to the Secteur in Symfony 4

$
0
0

The line $groupement[] = null === $secteurs ? null : $secteurs->getSecteurid(); in the Eleveurtype.php is not working Please i need Some help The work i wanted to do is to select one Secteur and then i want to get all groupements belong to the Secteur

This is The EleveurType.php

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder
        ->add('secteurid',EntityType::class, [
            'label'=>'Nom du secteur :',
            'class'  => Secteurs::class,
            'choice_label' => 'secteurfr',
            'attr'=>[
                'class'=>'form-control',
            ] 
        ])
    ;

    $formModifier = function (FormInterface $form, Secteurs $secteurs = null) {
        //$secteurs = null === $secteurs ? [] : $secteurs->getSecteurid();
        $groupement[] = null === $secteurs ? null : $secteurs->getSecteurid();
        $form->add('groupementid', EntityType::class, [
            'class' => Groupements::class,
            'placeholder' => '',
            'choices' => $groupement,
            'attr'=>[
                'class'=>'form-control',
            ]
        ]);
    };
    $builder->addEventListener(
        FormEvents::PRE_SET_DATA,
        function (FormEvent $event) use ($formModifier) {
            // this would be your entity, i.e. SportMeetup
            $data = $event->getData();

            $formModifier($event->getForm(), $data->getSecteurid());
        }
    );
    $builder->get('secteurid')->addEventListener(
        FormEvents::POST_SUBMIT,
        function (FormEvent $event) use ($formModifier) {
            // It's important here to fetch $event->getForm()->getData(), as
            // $event->getData() will get you the client data (that is, the ID)
            $secteur = $event->getForm()->getData();

            // since we've added the listener to the child, we'll have to pass on
            // the parent to the callback functions!
            $formModifier($event->getForm()->getParent(), $secteur);
        }
    );

}

This is The _form.html.twig Eleveur

{{ form_start(form, {'attr': {'id': 'newform', 'nam': nam } }) }}
    {{ form_widget(form) }}


    <button type="button" class="{{ classBtnAddEdit|default('btn btnAED btn-success waves-effect waves-light m-1') }} " id="btnAddEdit"><i class="fa fa-check-square-o"></i> Enregistrer</button>
{{ form_end(form) }}
<script>
    var $secteur = $('#eleveurs_secteurid');
    // When sport gets selected ...
    $secteur.change(function() {
        // ... retrieve the corresponding form.
        var $form = $(this).closest('form');
        // Simulate form data, but only include the selected sport value.
        var data = {};
        data[$secteur.attr('name')] = $secteur.val();
        // Submit data via AJAX to the form's action path.
        $.ajax({
            url : $form.attr('nam'), //= $form.attr('action'),
            type: $form.attr('method'),
            data : data,
            success: function(html) {
                // Replace current position field ...
                $('#eleveurs_groupementid').replaceWith(
                    // ... with the returned one from the AJAX response.
                    $(html).find('#eleveurs_groupementid')
                );
                // Position field now displays the appropriate positions.
            }
        });
    });
</script>

** this is the Eleveur Class Eleveur **

<?php

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * Eleveurs
 *
 * @ORM\Table(name="eleveurs", indexes={@ORM\Index(name="fk_relationship_47", columns={"groupementid"}), @ORM\Index(name="fk_relationship_53", columns={"douarid"}), @ORM\Index(name="fk_relationship_16", columns={"secteurid"}), @ORM\Index(name="fk_relationship_49", columns={"villeid"})})
 * @ORM\Entity
 */
class Eleveurs
{
    /**
     * @var int
     *
     * @ORM\Column(name="eleveurid", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $eleveurid;

    /**
     * @var string|null
     *
     * @ORM\Column(name="codeeleveur", type="text", length=65535, nullable=true)
     */
    private $codeeleveur;

    /**
     * @var string|null
     *
     * @ORM\Column(name="numcin", type="text", length=65535, nullable=true)
     */
    private $numcin;

    /**
     * @var \DateTime|null
     *
     * @ORM\Column(name="datecin", type="date", nullable=true)
     */
    private $datecin;

    /**
     * @var \DateTime|null
     *
     * @ORM\Column(name="validitecin", type="date", nullable=true)
     */
    private $validitecin;

    /**
     * @var string|null
     *
     * @ORM\Column(name="nomfr", type="text", length=65535, nullable=true)
     */
    private $nomfr;

    /**
     * @var string|null
     *
     * @ORM\Column(name="prenomfr", type="text", length=65535, nullable=true)
     */
    private $prenomfr;

    /**
     * @var string|null
     *
     * @ORM\Column(name="nomar", type="text", length=65535, nullable=true)
     */
    private $nomar;

    /**
     * @var string|null
     *
     * @ORM\Column(name="prenomar", type="text", length=65535, nullable=true)
     */
    private $prenomar;

    /**
     * @var \DateTime|null
     *
     * @ORM\Column(name="dateadhesion", type="date", nullable=true)
     */
    private $dateadhesion;

    /**
     * @var string|null
     *
     * @ORM\Column(name="adressefr", type="text", length=65535, nullable=true)
     */
    private $adressefr;

    /**
     * @var string|null
     *
     * @ORM\Column(name="adressear", type="text", length=65535, nullable=true)
     */
    private $adressear;

    /**
     * @var int|null
     *
     * @ORM\Column(name="effectifovin", type="integer", nullable=true)
     */
    private $effectifovin;

    /**
     * @var int|null
     *
     * @ORM\Column(name="effectifcaprin", type="integer", nullable=true)
     */
    private $effectifcaprin;

    /**
     * @var \Secteurs
     *
     * @ORM\ManyToOne(targetEntity="Secteurs")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="secteurid", referencedColumnName="secteurid")
     * })
     */
    private $secteurid;

    /**
     * @var \Groupements
     *
     * @ORM\ManyToOne(targetEntity="Groupements")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="groupementid", referencedColumnName="groupementid")
     * })
     */
    private $groupementid;

    /**
     * @var \Villes
     *
     * @ORM\ManyToOne(targetEntity="Villes")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="villeid", referencedColumnName="villeid")
     * })
     */
    private $villeid;

    /**
     * @var \Douars
     *
     * @ORM\ManyToOne(targetEntity="Douars")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="douarid", referencedColumnName="douarid")
     * })
     */
    private $douarid;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Conseilgroupement", mappedBy="eleveurid")
     */
    private $conseilgroupementid;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Droitfonctionement", inversedBy="eleveurid")
     * @ORM\JoinTable(name="relationship_32",
     *   joinColumns={
     *     @ORM\JoinColumn(name="eleveurid", referencedColumnName="eleveurid")
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="droitfonctionementid", referencedColumnName="droitfonctionementid")
     *   }
     * )
     */
    private $droitfonctionementid;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Conseilanoc", mappedBy="eleveurid")
     */
    private $conseilanocid;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Superviseurs", mappedBy="eleveurid")
     */
    private $histosuperviseurid;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->conseilgroupementid = new \Doctrine\Common\Collections\ArrayCollection();
        $this->droitfonctionementid = new \Doctrine\Common\Collections\ArrayCollection();
        $this->conseilanocid = new \Doctrine\Common\Collections\ArrayCollection();
        $this->histosuperviseurid = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function getEleveurid(): ?int
    {
        return $this->eleveurid;
    }

    public function getCodeeleveur(): ?string
    {
        return $this->codeeleveur;
    }

    public function setCodeeleveur(?string $codeeleveur): self
    {
        $this->codeeleveur = $codeeleveur;

        return $this;
    }

    public function getNumcin(): ?string
    {
        return $this->numcin;
    }

    public function setNumcin(?string $numcin): self
    {
        $this->numcin = $numcin;

        return $this;
    }

    public function getDatecin(): ?\DateTimeInterface
    {
        return $this->datecin;
    }

    public function setDatecin(?\DateTimeInterface $datecin): self
    {
        $this->datecin = $datecin;

        return $this;
    }

    public function getValiditecin(): ?\DateTimeInterface
    {
        return $this->validitecin;
    }

    public function setValiditecin(?\DateTimeInterface $validitecin): self
    {
        $this->validitecin = $validitecin;

        return $this;
    }

    public function getNomfr(): ?string
    {
        return $this->nomfr;
    }

    public function setNomfr(?string $nomfr): self
    {
        $this->nomfr = $nomfr;

        return $this;
    }

    public function getPrenomfr(): ?string
    {
        return $this->prenomfr;
    }

    public function setPrenomfr(?string $prenomfr): self
    {
        $this->prenomfr = $prenomfr;

        return $this;
    }

    public function getNomar(): ?string
    {
        return $this->nomar;
    }

    public function setNomar(?string $nomar): self
    {
        $this->nomar = $nomar;

        return $this;
    }

    public function getPrenomar(): ?string
    {
        return $this->prenomar;
    }

    public function setPrenomar(?string $prenomar): self
    {
        $this->prenomar = $prenomar;

        return $this;
    }

    public function getDateadhesion(): ?\DateTimeInterface
    {
        return $this->dateadhesion;
    }

    public function setDateadhesion(?\DateTimeInterface $dateadhesion): self
    {
        $this->dateadhesion = $dateadhesion;

        return $this;
    }

    public function getAdressefr(): ?string
    {
        return $this->adressefr;
    }

    public function setAdressefr(?string $adressefr): self
    {
        $this->adressefr = $adressefr;

        return $this;
    }

    public function getAdressear(): ?string
    {
        return $this->adressear;
    }

    public function setAdressear(?string $adressear): self
    {
        $this->adressear = $adressear;

        return $this;
    }

    public function getEffectifovin(): ?int
    {
        return $this->effectifovin;
    }

    public function setEffectifovin(?int $effectifovin): self
    {
        $this->effectifovin = $effectifovin;

        return $this;
    }

    public function getEffectifcaprin(): ?int
    {
        return $this->effectifcaprin;
    }

    public function setEffectifcaprin(?int $effectifcaprin): self
    {
        $this->effectifcaprin = $effectifcaprin;

        return $this;
    }

    public function getSecteurid(): ?Secteurs
    {
        return $this->secteurid;
    }

    public function setSecteurid(?Secteurs $secteurid): self
    {
        $this->secteurid = $secteurid;

        return $this;
    }

    public function getGroupementid(): ?Groupements
    {
        return $this->groupementid;
    }

    public function setGroupementid(?Groupements $groupementid): self
    {
        $this->groupementid = $groupementid;

        return $this;
    }

    public function getVilleid(): ?Villes
    {
        return $this->villeid;
    }

    public function setVilleid(?Villes $villeid): self
    {
        $this->villeid = $villeid;

        return $this;
    }

    public function getDouarid(): ?Douars
    {
        return $this->douarid;
    }

    public function setDouarid(?Douars $douarid): self
    {
        $this->douarid = $douarid;

        return $this;
    }

    /**
     * @return Collection|Conseilgroupement[]
     */
    public function getConseilgroupementid(): Collection
    {
        return $this->conseilgroupementid;
    }

    public function addConseilgroupementid(Conseilgroupement $conseilgroupementid): self
    {
        if (!$this->conseilgroupementid->contains($conseilgroupementid)) {
            $this->conseilgroupementid[] = $conseilgroupementid;
            $conseilgroupementid->addEleveurid($this);
        }

        return $this;
    }

    public function removeConseilgroupementid(Conseilgroupement $conseilgroupementid): self
    {
        if ($this->conseilgroupementid->contains($conseilgroupementid)) {
            $this->conseilgroupementid->removeElement($conseilgroupementid);
            $conseilgroupementid->removeEleveurid($this);
        <

** This is the Secteur class **

<?php

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Secteurs
 *
 * @ORM\Table(name="secteurs")
 * @ORM\Entity
 */
class Secteurs
{
    /**
     * @var int
     *
     * @ORM\Column(name="secteurid", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $secteurid;

    /**
     * @var string|null
     *
     * @ORM\Column(name="secteurfr", type="text", length=65535, nullable=true)
     */
    private $secteurfr;

    /**
     * @var string|null
     *
     * @ORM\Column(name="secteurar", type="text", length=65535, nullable=true)
     */
    private $secteurar;

    /**
     * @var string|null
     *
     * @ORM\Column(name="codesecteur", type="text", length=65535, nullable=true)
     */
    private $codesecteur;

    public function getSecteurid(): ?int
    {
        return $this->secteurid;
    }

    public function getSecteurfr(): ?string
    {
        return $this->secteurfr;
    }

    public function setSecteurfr(?string $secteurfr): self
    {
        $this->secteurfr = ucfirst($secteurfr);

        return $this;
    }

    public function getSecteurar(): ?string
    {
        return $this->secteurar;
    }

    public function setSecteurar(?string $secteurar): self
    {
        $this->secteurar = $secteurar;

        return $this;
    }

    public function getCodesecteur(): ?string
    {
        return $this->codesecteur;
    }

    public function setCodesecteur(?string $codesecteur): self
    {
        $this->codesecteur = strtoupper($codesecteur);

        return $this;
    }


}

** this is the groupement class **

<?php

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
 * Groupements
 *
 * @ORM\Table(name="groupements", indexes={@ORM\Index(name="fk_relationship_54", columns={"secteurid"})})
 * @ORM\Entity
 */
class Groupements
{
    /**
     * @var int
     *
     * @ORM\Column(name="groupementid", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $groupementid;

    /**
     * @var string|null
     *
     * @ORM\Column(name="groupementmereid", type="decimal", precision=8, scale=0, nullable=true)
     */
    private $groupementmereid;

    /**
     * @var string|null
     *
     * @ORM\Column(name="codegroupement", type="text", length=65535, nullable=true)
     */
    private $codegroupement;

    /**
     * @var string|null
     *
     * @ORM\Column(name="nomgroupementfr", type="text", length=65535, nullable=true)
     */
    private $nomgroupementfr;

    /**
     * @var string|null
     *
     * @ORM\Column(name="nomgroupementar", type="text", length=65535, nullable=true)
     */
    private $nomgroupementar;

    /**
     * @var string|null
     *
     * @ORM\Column(name="adressepostale", type="text", length=65535, nullable=true)
     */
    private $adressepostale;

    /**
     * @var \DateTime|null
     *
     * @ORM\Column(name="datecreation", type="date", nullable=true)
     */
    private $datecreation;

    /**
     * @var string|null
     *
     * @ORM\Column(name="pvcreation", type="text", length=65535, nullable=true)
     */
    private $pvcreation;

    /**
     * @var float|null
     *
     * @ORM\Column(name="droitfonctionement", type="float", precision=10, scale=0, nullable=true)
     */
    private $droitfonctionement;

    /**
     * @var float|null
     *
     * @ORM\Column(name="autrecotisations", type="float", precision=10, scale=0, nullable=true)
     */
    private $autrecotisations;

    /**
     * @var string|null
     *
     * @ORM\Column(name="effectifovinencadre", type="decimal", precision=8, scale=0, nullable=true)
     */
    private $effectifovinencadre;

    /**
     * @var string|null
     *
     * @ORM\Column(name="effectifcaprinencadre", type="decimal", precision=8, scale=0, nullable=true)
     */
    private $effectifcaprinencadre;

    /**
     * @var string|null
     *
     * @ORM\Column(name="lieupvcreation", type="text", length=65535, nullable=true)
     */
    private $lieupvcreation;

    /**
     * @var \DateTime|null
     *
     * @ORM\Column(name="datepvcreation", type="date", nullable=true)
     */
    private $datepvcreation;

    /**
     * @var \Secteurs
     *
     * @ORM\ManyToOne(targetEntity="Secteurs")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="secteurid", referencedColumnName="secteurid")
     * })
     */
    private $secteurid;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Droitfonctionement", inversedBy="groupementid")
     * @ORM\JoinTable(name="relationship_31",
     *   joinColumns={
     *     @ORM\JoinColumn(name="groupementid", referencedColumnName="groupementid")
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="droitfonctionementid", referencedColumnName="droitfonctionementid")
     *   }
     * )
     */
    private $droitfonctionementid;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->droitfonctionementid = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function getGroupementid(): ?int
    {
        return $this->groupementid;
    }

    public function getGroupementmereid(): ?string
    {
        return $this->groupementmereid;
    }

    public function setGroupementmereid(?string $groupementmereid): self
    {
        $this->groupementmereid = $groupementmereid;

        return $this;
    }

    public function getCodegroupement(): ?string
    {
        return $this->codegroupement;
    }

    public function setCodegroupement(?string $codegroupement): self
    {
        $this->codegroupement = $codegroupement;

        return $this;
    }

    public function getNomgroupementfr(): ?string
    {
        return $this->nomgroupementfr;
    }

    public function setNomgroupementfr(?string $nomgroupementfr): self
    {
        $this->nomgroupementfr = $nomgroupementfr;

        return $this;
    }

    public function getNomgroupementar(): ?string
    {
        return $this->nomgroupementar;
    }

    public function setNomgroupementar(?string $nomgroupementar): self
    {
        $this->nomgroupementar = $nomgroupementar;

        return $this;
    }

    public function getAdressepostale(): ?string
    {
        return $this->adressepostale;
    }

    public function setAdressepostale(?string $adressepostale): self
    {
        $this->adressepostale = $adressepostale;

        return $this;
    }

    public function getDatecreation(): ?\DateTimeInterface
    {
        return $this->datecreation;
    }

    public function setDatecreation(?\DateTimeInterface $datecreation): self
    {
        $this->datecreation = $datecreation;

        return $this;
    }

    public function getPvcreation(): ?string
    {
        return $this->pvcreation;
    }

    public function setPvcreation(?string $pvcreation): self
    {
        $this->pvcreation = $pvcreation;

        return $this;
    }

    public function getDroitfonctionement(): ?float
    {
        return $this->droitfonctionement;
    }

    public function setDroitfonctionement(?float $droitfonctionement): self
    {
        $this->droitfonctionement = $droitfonctionement;

        return $this;
    }

    public function getAutrecotisations(): ?float
    {
        return $this->autrecotisations;
    }

    public function setAutrecotisations(?float $autrecotisations): self
    {
        $this->autrecotisations = $autrecotisations;

        return $this;
    }

    public function getEffectifovinencadre(): ?string
    {
        return $this->effectifovinencadre;
    }

    public function setEffectifovinencadre(?string $effectifovinencadre): self
    {
        $this->effectifovinencadre = $effectifovinencadre;

        return $this;
    }

    public function getEffectifcaprinencadre(): ?string
    {
        return $this->effectifcaprinencadre;
    }

    public function setEffectifcaprinencadre(?string $effectifcaprinencadre): self
    {
        $this->effectifcaprinencadre = $effectifcaprinencadre;

        return $this;
    }

    public function getLieupvcreation(): ?string
    {
        return $this->lieupvcreation;
    }

    public function setLieupvcreation(?string $lieupvcreation): self
    {
        $this->lieupvcreation = $lieupvcreation;

        return $this;
    }

    public function getDatepvcreation(): ?\DateTimeInterface
    {
        return $this->datepvcreation;
    }

    public function setDatepvcreation(?\DateTimeInterface $datepvcreation): self
    {
        $this->datepvcreation = $datepvcreation;

        return $this;
    }

    public function getSecteurid(): ?Secteurs
    {
        return $this->secteurid;
    }

    public function setSecteurid(?Secteurs $secteurid): self
    {
        $this->secteurid = $secteurid;

        return $this;
    }

    /**
     * @return Collection|Droitfonctionement[]
     */
    public function getDroitfonctionementid(): Collection
    {
        return $this->droitfonctionementid;
    }

    public function addDroitfonctionementid(Droitfonctionement $droitfonctionementid): self
    {
        if (!$this->droitfonctionementid->contains($droitfonctionementid)) {
            $this->droitfonctionementid[] = $droitfonctionementid;
        }

        return $this;
    }

    public function removeDroitfonctionementid(Droitfonctionement $droitfonctionementid): self
    {
        if ($this->droitfonctionementid->contains($droitfonctionementid)) {
            $this->droitfonctionementid->removeElement($droitfonctionementid);
        }

        return $this;
    }

}

API Symfony 4 / Reactjs / Paybox - submit a form from back side and send its redirection to front side for payment

$
0
0

i'm trying to make a payment with paybox and I want to do all this in back side (Api Symfony). The paybox documentation give us an example to implement the payment here http://www1.paybox.com/espace-integrateur-documentation/la-solution-paybox-system/appel-page-paiement/

I want to click on a "Pay" button in reactjs which call my api route (symfony), in which i render my paybox view with paybox data and i want to submit my form directly to redirect to paybox platform for payment but i don't receive a redirection response but the html content page.

My Paybox controller :

public function paybox(int $agreementId, Request $request)
    {
        $user = $this->getUser();
        $agreement = $this->agreementService->findUserAgreementByAgreementId($user->getId(), $agreementId);

        $paybox = $this->payboxService->getPayboxData($agreement);

        return $this->render('paybox/paybox.html.twig', [
           'paybox' => $paybox
        ]);
}

My paybox.html.twig :

<html>
    <body onload="document.payboxForm.submit()">
        <form action="{{ paybox_url }}" name="payboxForm">
            <input type="hidden" name="PBX_SITE"        value="{{ paybox.pbxSite }}">
            <input type="hidden" name="PBX_RANG"        value="{{ paybox.pbxRang }}">
            <input type="hidden" name="PBX_IDENTIFIANT" value="{{ paybox.pbxIdentifiant }}">
            <input type="hidden" name="PBX_TOTAL"       value="{{ paybox.pbxTotal }}">
            <input type="hidden" name="PBX_DEVISE"      value="{{ paybox.pbxDevise }}">
            <input type="hidden" name="PBX_CMD"         value="{{ paybox.pbxCmd }}">
            <input type="hidden" name="PBX_PORTEUR"     value="{{ paybox.pbxPorteur }}">
            <input type="hidden" name="PBX_RETOUR"      value="{{ paybox.pbxRetour }}">
            <input type="hidden" name="PBX_HASH"        value="{{ paybox.pbxHash }}">
            <input type="hidden" name="PBX_TIME"        value="{{ paybox.pbxTime }}">
            <input type="hidden" name="PBX_HMAC"        value="{{ paybox.pbxHmac }}">
            <input type="hidden" name="PBX_EFFECTUE"    value="{{ paybox.pbxEffectue }}">
            <input type="hidden" name="PBX_REFUSE"      value="{{ paybox.pbxRefuse }}">
            <input type="hidden" name="PBX_ANNULE"      value="{{ paybox.pbxAnnule }}">
            <input type="submit" value="Payer">
        </form>
    </body>
</html>

I want to send the redirection to my reactjs app when clicking the 'Pay' button. And redirect the front page to the paybox platform. But all the mecanism is done in back side.

Symfony profiler performance time %0.2f

$
0
0

Sometime in the last couple of days, symfony profiler stopped displaying all time and size measurements and displays the formatting parameter, such as %.2f instead. I couldn't think of anything that could have changed on the machine, and also tried reinstalling all symfony libraries to no avail.

I am using symfony 4.4

Here is how it looks:

enter image description here

Any help to point me in the right direction would be appreciated

Viewing all 3916 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>