mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 08:03:49 +00:00
edit template & update action
This commit is contained in:
46
Form/Type/CivilType.php
Normal file
46
Form/Type/CivilType.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace CL\Chill\PersonBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
use CL\Chill\PersonBundle\Entity\Person;
|
||||
|
||||
/**
|
||||
* A type to select the civil union state
|
||||
*
|
||||
* @author julien
|
||||
*/
|
||||
class CivilType extends AbstractType {
|
||||
|
||||
|
||||
public function getName() {
|
||||
return 'civil';
|
||||
}
|
||||
|
||||
public function getParent() {
|
||||
return 'choice';
|
||||
}
|
||||
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver) {
|
||||
|
||||
$rootTranslate = 'person.civil_union.';
|
||||
|
||||
$a = array(
|
||||
Person::CIVIL_COHAB => $rootTranslate.Person::CIVIL_COHAB,
|
||||
Person::CIVIL_DIVORCED => $rootTranslate.Person::CIVIL_DIVORCED,
|
||||
Person::CIVIL_SEPARATED => $rootTranslate.Person::CIVIL_SEPARATED,
|
||||
Person::CIVIL_SINGLE => $rootTranslate.Person::CIVIL_SINGLE,
|
||||
Person::CIVIL_UNKNOW => $rootTranslate.Person::CIVIL_UNKNOW,
|
||||
Person::CIVIL_WIDOW => $rootTranslate.Person::CIVIL_WIDOW
|
||||
);
|
||||
|
||||
$resolver->setDefaults(array(
|
||||
'choices' => $a,
|
||||
'expanded' => false,
|
||||
'multiple' => false,
|
||||
|
||||
));
|
||||
}
|
||||
|
||||
}
|
42
Form/Type/GenderType.php
Normal file
42
Form/Type/GenderType.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace CL\Chill\PersonBundle\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
||||
use CL\Chill\PersonBundle\Entity\Person;
|
||||
|
||||
/**
|
||||
* A type to select the civil union state
|
||||
*
|
||||
* @author julien
|
||||
*/
|
||||
class GenderType extends AbstractType {
|
||||
|
||||
|
||||
public function getName() {
|
||||
return 'gender';
|
||||
}
|
||||
|
||||
public function getParent() {
|
||||
return 'choice';
|
||||
}
|
||||
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver) {
|
||||
|
||||
$rootTranslate = 'person.gender.';
|
||||
|
||||
$a = array(
|
||||
Person::GENRE_MAN => $rootTranslate.Person::GENRE_MAN,
|
||||
Person::GENRE_WOMAN => $rootTranslate.Person::GENRE_WOMAN
|
||||
);
|
||||
|
||||
$resolver->setDefaults(array(
|
||||
'choices' => $a,
|
||||
'expanded' => true,
|
||||
'multiple' => false,
|
||||
'empty_value' => $rootTranslate.'undefined'
|
||||
));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user