This file contains 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
// fichier config : | |
'routes' => array( | |
'mere' => array( | |
'type' => 'Literal', | |
''options' => array( | |
'route' => '/jeu' | |
) | |
) | |
) |
This file contains 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
// In my form : | |
$hydrator = new ClassMethodsHydrator(false); | |
$hydrator->addStrategy('city', new HydratorStrategy\City()); | |
$this->setHydrator(new DoctrineHydrator(Registry::get('EntityManager'), $hydrator)) | |
->setObject(new AddressEntity()); | |
$this->add(array( | |
'name' => 'city', |
This file contains 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
$this->add(array( | |
'type' => 'Zend\Form\Element\Csrf', | |
'name' => 'csrf', | |
'options' => array( | |
'csrf_options' => array( | |
'timeout' => 456, | |
// autres options du CSRF | |
) | |
) | |
)); |
This file contains 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
$this->add(array( | |
'type' => 'Zend\Form\Element\Csrf', | |
'name' => 'csrf', | |
'options' => array( | |
'csrf_options' => array( | |
'timeout' => ... | |
) | |
) | |
)); |
This file contains 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 if (count($bases) === 0): ?> | |
<?php foreach ($bases as $base): ?> | |
<?php echo $base->getName(); ?> | |
<?php endforeach; ?> | |
<?php else: ?> | |
<p>Aucune base</p> | |
<?php endif; ?> |
This file contains 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
{% for base in bases if base.active() %} | |
{{ base.getName() }} | |
{% else %} | |
<p>Aucune base</p> |
This file contains 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
$queryBuilder->select('COUNT(a.id) AS sentApplications') | |
->addSelect('SUM(CASE WHEN a.status = :accepted THEN 1 ELSE 0 END) AS acceptedApplications') | |
->addSelect('SUM(CASE WHEN a.status = :accepted AND m.status = :filled THEN 1 ELSE 0 END) AS activeMissions') | |
->addSelect('SUM(CASE WHEN a.status = :accepted AND m.status = :finished THEN 1 ELSE 0 END) AS finishedMissions') | |
->from('Mission\Entity\Application', 'a') | |
->join('a.mission', 'm') | |
->where('a.student = :student') | |
->setParameter('accepted', ApplicationEntity::ACCEPTED) | |
->setParameter('filled', MissionEntity::FILLED) | |
->setParameter('finished', MissionEntity::FINISHED) |
This file contains 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
$this->add(array( | |
'type' => 'Zend\Form\Element\DateSelect', | |
'name' => 'birthDate', | |
'options' => array( | |
'label' => 'Date de naissance', | |
'create_empty_option' => true, | |
'min_year' => date('Y') - 30, | |
'max_year' => date('Y') - 18, | |
'day_attributes' => array( | |
'data-placeholder' => 'Jour', |
This file contains 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 | |
// Par défaut, Doctrine t'offre ces différents events : | |
// PostLoad, PostPersist, PostRemove, PostUpdate | |
// PrePersist, PreRemove, PreUpdate | |
/** | |
* @ORM\Entity | |
* @ORM\HasLifecycleCallbacks // <=== Active le mécanisme d'évènements | |
*/ |
This file contains 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
// layout.phtml | |
<!doctype html> | |
<html> | |
<head> | |
<?php echo $this->headStyle(); ?> | |
<?php echo $this->headScript(); ?> | |
</head> | |
</html> |