This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity(repositoryClass="App\Repository\LoginAttemptRepository") | |
* @ORM\Table() | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
use Symfony\Component\Routing\Annotation\Route; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
class MyController extends AbstractController | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
class ExampleController extends AbstractController | |
{ | |
public function pageAvecUnUtilisateur(UserInterface $user) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$email = (new Email()) | |
->from('[email protected]') | |
->to('[email protected]') | |
->subject('Bien le bonjour!') | |
->text('Ceci sera le contenu txt') | |
->html('Et ceci la version <code>HTML</code>') | |
; | |
$transport = Transport::*fromDsn*(getenv('MAILER_URL')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% block subject %}Ce week-end{% endblock %} | |
{% block html %} | |
Bonjour,<br /> | |
<p> | |
Chers collègues de <a href="http://netinfluence.ch">netinfluence</a>, fait-on une <em>fondue</em> ce week-end? | |
</p> | |
Romaric |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Type; | |
use Doctrine\DBAL\Platforms\AbstractPlatform; | |
use Doctrine\DBAL\Types\ConversionException; | |
use Doctrine\DBAL\Types\Type; | |
class DateTimeImmutableUtcType extends Type | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* @ORM\Entity() | |
*/ | |
class Event |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Type; | |
use Doctrine\DBAL\Platforms\AbstractPlatform; | |
use Doctrine\DBAL\Types\ConversionException; | |
use Doctrine\DBAL\Types\Type; | |
class DateTimeUtcType extends Type | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// L'astuce est bien de récupérer l'instance StopWatch du container, | |
// éventuellement via auto-injection (sous Symfony 4), | |
// mais pas d'en créer une nouvelle (ie, new Stopwatch()...). | |
$stopwatch = $this->container->get('debug.stopwatch'); | |
$stopwatch->start('mon_temps', 'netinfluence'); | |
// ... | |
usleep(100); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\DataCollector; | |
use Doctrine\Common\Annotations\AnnotationReader; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\HttpKernel\DataCollector\DataCollector; |