For twig

base.html.twig :

<p{{ 'message'|trans }}</p>

Create or update your files translation :

# tempate from app/Resources
php bin/console translation:update --dump-messages --force fr
php bin/console translation:update --dump-messages --force en

# template from AppBundle/Resources
php bin/console translation:update --dump-messages --force fr AppBundle
php bin/console translation:update --dump-messages --force en AppBundle

 

How to add expire header on Ubuntu with Apache2 :

Edit your httpd.conf

  1. The module ‘mod_expires’ must be activated
  2. Add the new configuration

1) Activate mod_expires

sudo a2enmod expires
sudo /etc/init.d/apache2 restart

2) Add new lines on your httpd.conf

nano /etc/apache2/apache2.conf

Then add these lines at the end

ExpiresActive On
ExpiresByType image/gif “access 1 month”
ExpiresByType image/jpg “access 1 month”
ExpiresByType image/jpeg “access 1 month”
ExpiresByType image/png “access 1 month”
ExpiresByType text/css “access 1 month”
ExpiresByType text/js “access 1 week”
ExpiresByType application/javascript “access 1 week”

the restart

sudo /etc/init.d/apache2 restart

Example :

Check to make sure you have mod_rewrite enabled.

Under Apache 2+

sudo a2enmod rewrite && sudo service apache2 restart

or

sudo a2enmod rewrite && sudo /etc/init.d/apache2 restart

 

You can use an “array” :

$to = array(
            "user1@gmail.com" => "User 1",
            "user2@gmail.com" => "User 2"
        );

 

Example :

$subject = "User";

        $to = array(
            "user1@gmail.com" => "User 1",
            "user2@gmail.com" => "User 2"
        );

        $from = "contact@become-developer.com";
        $name = "Become Developer";

        $body = "content";

$message = \Swift_Message::newInstance()
            ->setSubject($subject)
            ->setFrom($from)
            ->setTo($to)
            ->setBody($body)
            /*
             * If you also want to include a plaintext version of the message
            ->addPart(
                $this->renderView(
                    'Emails/registration.txt.twig',
                    array('name' => $name)
                ),
                'text/plain'
            )
            */
        ;

        // or, you can also fetch the mailer service this way
        // $this->get('mailer')->send($message);
        return $this->mailer->send($message);

 

This error appear because your type not a “Array”

 

Change type to “array”

    /**
     * @var string
     *
     * @ORM\Column(name="informations", type="array")
     * */
    private $informations;

Then update your database with Command Symfony

Tip :

var url = '{{ path("yourroute", {'id': 'id'}) }}'; 
url = url.replace("id", this.value);

window.location.href = url;

 

app.request.get('id')

 

Define the real entity:

 * @ORM\Entity

For example

Before :

<?php

namespace BookingBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name="booking")
 */
class Booking
{

After :

<?php

namespace BookingBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="booking")
 */
class Booking
{

 

I share with you the solution :

Create a link /var/www

sudo ln -s /usr/share/phpmyadmin /var/www/
sudo nano /etc/apache2/apache2.conf

Then add the following line :

Include /etc/phpmyadmin/apache.conf

then Restart your apache

sudo service apache2 reload

 

 

Il faut impérativement ajouter son bundle dans le fichier composer.json comme ceci par exemple

 

"autoload": {
        "psr-4": {
            "AppBundle\\": "src/AppBundle",
            "Acme\\Bundle\\BlogBundle\\": "src/Acme/Bundle/BlogBundle",
            "BlogBundle\\": "src/BlogBundle",
            "LangueBundle\\": "src/LangueBundle",
            "PaymentALBundle\\": "src/PaymentALBundle"

        },
        "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
    },

Et puis exécuter cette commande :

composer dumpautoload