par
syrine01 » 11 juil. 2016, 14:59
j'ai essayé de corriger mon code et voilà la dernier version:
Code : Tout sélectionner
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('groups', 'entity',array(
'class' => 'GroupsBundle:Roles',
'property' => 'name_role',
'required' => false,
'placeholder' => 'Choisir le role du votre groupe'
)
)
->add('permissions_role','entity',array(
'class' => 'GroupsBundle:Permissions',
'property' => 'name_permissions',
'multiple' => true,
'expanded' => true,
'required' => true
)
)
;
}
Le formulaire est bien affiché avec les différents rôles et les permissions sauf que le serveur ne peut pas traité la requête (j'en sais pas pourquoi !!):
//l'erreur
The 127.0.0.1 page isn’t working
127.0.0.1 is currently unable to handle this request.
HTTP ERROR
Voilà le fichier log du mon serveur SF 2.7:
Code : Tout sélectionner
Dev.log
[2016-07-12 00:23:49] doctrine.DEBUG: SELECT p0_.id_per AS id_per0, p0_.nom_permisions AS nom_permisions1 FROM permissions p0_ [] []
[2016-07-12 00:23:49] doctrine.DEBUG: SELECT r0_.id AS id0, r0_.nom_roles AS nom_roles1 FROM roles r0_ WHERE r0_.id IN (?) [["0"]] []
[2016-07-12 01:51:58] php.DEBUG: fsockopen(): unable to connect to 127.0.0.1:8000 (Connection refused) {"type":2,"file":"/home/syrine01/Desktop/Project_Console/
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"l
evel":28928} [] // ici le probléme
WARNING - Translation not found.
Context: {"id":"Image","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"File","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Name groups","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Nom du groupe","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Role","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Groups","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Choisir le role du votre groupe","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Permissions role","domain":"messages","locale":"fr"}
WARNING - Translation not found.
INFO - Matched route "groups_new".
Context: {"route_parameters":{"_controller":"MemberShipManagement\\GroupsBundle\\Controller\\
GroupsController::newAction","_route":"groups_new"},"request_uri":"http://127.0.0.1:8000/groups/new"}
DEPRECATED - The Symfony\Component\Form\Extension\Csrf\CsrfProvider\
CsrfProviderAdapter class is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead. +
INFO - Populated the TokenStorage with an anonymous Token.
DEPRECATED - MemberShipManagement\GroupsBundle\Form\GroupsType:
The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. +
DEPRECATED - MemberShipManagement\GroupsBundle\Form\ImagesType:
The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. +
DEPRECATED - MemberShipManagement\GroupsBundle\Form\RolesType:
The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. +
DEPRECATED - The "property" option is deprecated since version 2.7
and will be removed in 3.0. Use "choice_label" instead.
Merci

j'ai essayé de corriger mon code et voilà la dernier version:
[code]
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('groups', 'entity',array(
'class' => 'GroupsBundle:Roles',
'property' => 'name_role',
'required' => false,
'placeholder' => 'Choisir le role du votre groupe'
)
)
->add('permissions_role','entity',array(
'class' => 'GroupsBundle:Permissions',
'property' => 'name_permissions',
'multiple' => true,
'expanded' => true,
'required' => true
)
)
;
}
[/code]
Le formulaire est bien affiché avec les différents rôles et les permissions sauf que le serveur ne peut pas traité la requête (j'en sais pas pourquoi !!):
[quote] //l'erreur
The 127.0.0.1 page isn’t working
127.0.0.1 is currently unable to handle this request.
HTTP ERROR
[/quote]
Voilà le fichier log du mon serveur SF 2.7:
[code]Dev.log
[2016-07-12 00:23:49] doctrine.DEBUG: SELECT p0_.id_per AS id_per0, p0_.nom_permisions AS nom_permisions1 FROM permissions p0_ [] []
[2016-07-12 00:23:49] doctrine.DEBUG: SELECT r0_.id AS id0, r0_.nom_roles AS nom_roles1 FROM roles r0_ WHERE r0_.id IN (?) [["0"]] []
[2016-07-12 01:51:58] php.DEBUG: fsockopen(): unable to connect to 127.0.0.1:8000 (Connection refused) {"type":2,"file":"/home/syrine01/Desktop/Project_Console/
vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php","line":59,"l
evel":28928} [] // ici le probléme
WARNING - Translation not found.
Context: {"id":"Image","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"File","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Name groups","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Nom du groupe","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Role","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Groups","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Choisir le role du votre groupe","domain":"messages","locale":"fr"}
WARNING - Translation not found.
Context: {"id":"Permissions role","domain":"messages","locale":"fr"}
WARNING - Translation not found.
INFO - Matched route "groups_new".
Context: {"route_parameters":{"_controller":"MemberShipManagement\\GroupsBundle\\Controller\\
GroupsController::newAction","_route":"groups_new"},"request_uri":"http://127.0.0.1:8000/groups/new"}
DEPRECATED - The Symfony\Component\Form\Extension\Csrf\CsrfProvider\
CsrfProviderAdapter class is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead. +
INFO - Populated the TokenStorage with an anonymous Token.
DEPRECATED - MemberShipManagement\GroupsBundle\Form\GroupsType:
The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. +
DEPRECATED - MemberShipManagement\GroupsBundle\Form\ImagesType:
The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. +
DEPRECATED - MemberShipManagement\GroupsBundle\Form\RolesType:
The FormTypeInterface::setDefaultOptions() method is deprecated since version 2.7 and will be removed in 3.0. Use configureOptions() instead. This method will be added to the FormTypeInterface with Symfony 3.0. +
DEPRECATED - The "property" option is deprecated since version 2.7
and will be removed in 3.0. Use "choice_label" instead. [/code]
Merci :)