{"id":18,"date":"2017-07-04T18:28:21","date_gmt":"2017-07-04T16:28:21","guid":{"rendered":"http:\/\/numa-bord.com\/miniblog\/?p=18"},"modified":"2017-09-21T19:19:49","modified_gmt":"2017-09-21T17:19:49","slug":"symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions","status":"publish","type":"post","link":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/","title":{"rendered":"Symfony : modifier les champs d&rsquo;un formulaire en fonction de son objet ou d&rsquo;options"},"content":{"rendered":"<p>Depuis le controller, c&rsquo;est un appel du formulaire classique, on ajoute juste les \u00e9ventuelles options si besoins<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"re0\">$form<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$this<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">createForm<\/span><span class=\"br0\">&#40;<\/span>ExampleFormType<span class=\"sy0\">::<\/span><span class=\"kw2\">class<\/span><span class=\"sy0\">,<\/span> <span class=\"re0\">$example<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'custom'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"kw4\">true<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/div>\n<p>Dans \u00ab\u00a0ExampleFormType\u00a0\u00bb d\u00e9finition de l&rsquo;option \u00ab\u00a0custom\u00a0\u00bb et utilisation des \u00ab\u00a0Form Events\u00a0\u00bb pour adapter les champs<\/p>\n<div class=\"codecolorer-container php default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"php codecolorer\"><span class=\"kw2\">use<\/span> Symfony\\Component\\Form\\AbstractType<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> Symfony\\Component\\Form\\FormBuilderInterface<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> Symfony\\Component\\OptionsResolver\\OptionsResolver<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> Symfony\\Component\\Form\\FormEvent<span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw2\">use<\/span> Symfony\\Component\\Form\\FormEvents<span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw2\">class<\/span> ExampleFormType <span class=\"kw2\">extends<\/span> AbstractType <span class=\"br0\">&#123;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> buildForm<span class=\"br0\">&#40;<\/span>FormBuilderInterface <span class=\"re0\">$builder<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a> <span class=\"re0\">$options<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$builder<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">addEventListener<\/span><span class=\"br0\">&#40;<\/span>FormEvents<span class=\"sy0\">::<\/span><span class=\"me2\">PRE_SET_DATA<\/span><span class=\"sy0\">,<\/span> <span class=\"kw2\">function<\/span> <span class=\"br0\">&#40;<\/span>FormEvent <span class=\"re0\">$event<\/span><span class=\"br0\">&#41;<\/span> <span class=\"kw2\">use<\/span><span class=\"br0\">&#40;<\/span><span class=\"re0\">$options<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$example<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$event<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">getData<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/recuperation de l'objet sur lequel le formulaire se base<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$form<\/span> <span class=\"sy0\">=<\/span> <span class=\"re0\">$event<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">getForm<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"co1\">\/\/recuperation du formulaire<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/en fonction du type de l'utilisateur les champs sont diff\u00e9rents<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><span class=\"re0\">$example<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">getStatus<\/span><span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">==<\/span> <span class=\"nu0\">1<\/span> <span class=\"sy0\">&amp;&amp;<\/span> <span class=\"re0\">$options<\/span><span class=\"br0\">&#91;<\/span><span class=\"st_h\">'custom'<\/span><span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$form<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">add<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'firstName'<\/span><span class=\"sy0\">,<\/span> <span class=\"kw4\">null<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'label'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'Pr\u00e9nom'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/....<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span> <span class=\"kw1\">else<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$form<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">add<\/span><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'lastName'<\/span><span class=\"sy0\">,<\/span> <span class=\"kw4\">null<\/span><span class=\"sy0\">,<\/span> <a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st_h\">'label'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'Nom'<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/....<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"kw2\">public<\/span> <span class=\"kw2\">function<\/span> configureOptions<span class=\"br0\">&#40;<\/span>OptionsResolver <span class=\"re0\">$resolver<\/span><span class=\"br0\">&#41;<\/span> <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">$resolver<\/span><span class=\"sy0\">-&gt;<\/span><span class=\"me1\">setDefaults<\/span><span class=\"br0\">&#40;<\/span><a href=\"http:\/\/www.php.net\/array\"><span class=\"kw3\">array<\/span><\/a><span class=\"br0\">&#40;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'data_class'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"st_h\">'AppBundle\\Entity\\Example'<\/span><span class=\"sy0\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st_h\">'custom'<\/span> <span class=\"sy0\">=&gt;<\/span> <span class=\"kw4\">false<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>Savoir si un champs est d\u00e9finis dans twig<\/p>\n<div class=\"codecolorer-container twig default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"twig codecolorer\"><span class=\"br0\">&#123;<\/span>% <a href=\"http:\/\/twig.sensiolabs.org\/doc\/tags\/if.html\"><span class=\"kw1\">if<\/span><\/a> <span class=\"re0\">form<\/span><span class=\"re1\">.firstName<\/span> <span class=\"kw5\">is<\/span> <a href=\"http:\/\/twig.sensiolabs.org\/doc\/tests\/defined.html\"><span class=\"kw4\">defined<\/span><\/a> %<span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><span class=\"br0\">&#123;<\/span>form_row<span class=\"br0\">&#40;<\/span>form<span class=\"re1\">.firstName<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#125;<\/span><span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span>% <a href=\"http:\/\/twig.sensiolabs.org\/doc\/tags\/endif.html\"><span class=\"kw1\">endif<\/span><\/a> %<span class=\"br0\">&#125;<\/span><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Depuis le controller, c&rsquo;est un appel du formulaire classique, on ajoute juste les \u00e9ventuelles options si besoins $form = $this-&gt;createForm&#40;ExampleFormType::class, $example, array&#40;&rsquo;custom&rsquo; =&gt; true&#41;&#41;; Dans \u00ab\u00a0ExampleFormType\u00a0\u00bb d\u00e9finition de l&rsquo;option \u00ab\u00a0custom\u00a0\u00bb et utilisation des \u00ab\u00a0Form Events\u00a0\u00bb pour adapter les champs use Symfony\\Component\\Form\\AbstractType; use Symfony\\Component\\Form\\FormBuilderInterface; use Symfony\\Component\\OptionsResolver\\OptionsResolver; use Symfony\\Component\\Form\\FormEvent; use Symfony\\Component\\Form\\FormEvents; class ExampleFormType extends AbstractType &#123; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-developpement","category-symfony"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Symfony : modifier les champs d&#039;un formulaire en fonction de son objet ou d&#039;options - Pense b\u00eate d&#039;un d\u00e9veloppeur web<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Symfony : modifier les champs d&#039;un formulaire en fonction de son objet ou d&#039;options - Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"og:description\" content=\"Depuis le controller, c&rsquo;est un appel du formulaire classique, on ajoute juste les \u00e9ventuelles options si besoins $form = $this-&gt;createForm&#040;ExampleFormType::class, $example, array&#040;&#039;custom&#039; =&gt; true&#041;&#041;; Dans \u00ab\u00a0ExampleFormType\u00a0\u00bb d\u00e9finition de l&rsquo;option \u00ab\u00a0custom\u00a0\u00bb et utilisation des \u00ab\u00a0Form Events\u00a0\u00bb pour adapter les champs use SymfonyComponentFormAbstractType; use SymfonyComponentFormFormBuilderInterface; use SymfonyComponentOptionsResolverOptionsResolver; use SymfonyComponentFormFormEvent; use SymfonyComponentFormFormEvents; class ExampleFormType extends AbstractType &#123; &nbsp; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/\" \/>\n<meta property=\"og:site_name\" content=\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-04T16:28:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-09-21T17:19:49+00:00\" \/>\n<meta name=\"author\" content=\"Numa\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"Numa\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/\"},\"author\":{\"name\":\"Numa\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"headline\":\"Symfony : modifier les champs d&rsquo;un formulaire en fonction de son objet ou d&rsquo;options\",\"datePublished\":\"2017-07-04T16:28:21+00:00\",\"dateModified\":\"2017-09-21T17:19:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/\"},\"wordCount\":204,\"commentCount\":0,\"articleSection\":[\"D\u00e9veloppement\",\"Symfony\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/\",\"name\":\"Symfony : modifier les champs d'un formulaire en fonction de son objet ou d'options - Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"isPartOf\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\"},\"datePublished\":\"2017-07-04T16:28:21+00:00\",\"dateModified\":\"2017-09-21T17:19:49+00:00\",\"author\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\"},\"breadcrumb\":{\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/numa-bord.com\/miniblog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Symfony : modifier les champs d&rsquo;un formulaire en fonction de son objet ou d&rsquo;options\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#website\",\"url\":\"https:\/\/numa-bord.com\/miniblog\/\",\"name\":\"Pense b\u00eate d&#039;un d\u00e9veloppeur web\",\"description\":\"(php, javascript, Symfony, Wordpress....)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e\",\"name\":\"Numa\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g\",\"caption\":\"Numa\"},\"url\":\"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Symfony : modifier les champs d'un formulaire en fonction de son objet ou d'options - Pense b\u00eate d&#039;un d\u00e9veloppeur web","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/","og_locale":"fr_FR","og_type":"article","og_title":"Symfony : modifier les champs d'un formulaire en fonction de son objet ou d'options - Pense b\u00eate d&#039;un d\u00e9veloppeur web","og_description":"Depuis le controller, c&rsquo;est un appel du formulaire classique, on ajoute juste les \u00e9ventuelles options si besoins $form = $this-&gt;createForm&#40;ExampleFormType::class, $example, array&#40;'custom' =&gt; true&#41;&#41;; Dans \u00ab\u00a0ExampleFormType\u00a0\u00bb d\u00e9finition de l&rsquo;option \u00ab\u00a0custom\u00a0\u00bb et utilisation des \u00ab\u00a0Form Events\u00a0\u00bb pour adapter les champs use SymfonyComponentFormAbstractType; use SymfonyComponentFormFormBuilderInterface; use SymfonyComponentOptionsResolverOptionsResolver; use SymfonyComponentFormFormEvent; use SymfonyComponentFormFormEvents; class ExampleFormType extends AbstractType &#123; &nbsp; [&hellip;]","og_url":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/","og_site_name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","article_published_time":"2017-07-04T16:28:21+00:00","article_modified_time":"2017-09-21T17:19:49+00:00","author":"Numa","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"Numa","Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#article","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/"},"author":{"name":"Numa","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"headline":"Symfony : modifier les champs d&rsquo;un formulaire en fonction de son objet ou d&rsquo;options","datePublished":"2017-07-04T16:28:21+00:00","dateModified":"2017-09-21T17:19:49+00:00","mainEntityOfPage":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/"},"wordCount":204,"commentCount":0,"articleSection":["D\u00e9veloppement","Symfony"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/","url":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/","name":"Symfony : modifier les champs d'un formulaire en fonction de son objet ou d'options - Pense b\u00eate d&#039;un d\u00e9veloppeur web","isPartOf":{"@id":"https:\/\/numa-bord.com\/miniblog\/#website"},"datePublished":"2017-07-04T16:28:21+00:00","dateModified":"2017-09-21T17:19:49+00:00","author":{"@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e"},"breadcrumb":{"@id":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/numa-bord.com\/miniblog\/symfony-modifier-champs-dun-formulaire-fonction-de-objet-doptions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/numa-bord.com\/miniblog\/"},{"@type":"ListItem","position":2,"name":"Symfony : modifier les champs d&rsquo;un formulaire en fonction de son objet ou d&rsquo;options"}]},{"@type":"WebSite","@id":"https:\/\/numa-bord.com\/miniblog\/#website","url":"https:\/\/numa-bord.com\/miniblog\/","name":"Pense b\u00eate d&#039;un d\u00e9veloppeur web","description":"(php, javascript, Symfony, Wordpress....)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/numa-bord.com\/miniblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Person","@id":"https:\/\/numa-bord.com\/miniblog\/#\/schema\/person\/f9d00acd1703f17e5a6895283eb46a7e","name":"Numa","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f21d1af4658a7106211915940584534c1e0b3eef3f12eb67a697686cad70b64a?s=96&d=mm&r=g","caption":"Numa"},"url":"https:\/\/numa-bord.com\/miniblog\/author\/negonner\/"}]}},"_links":{"self":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":5,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":164,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/posts\/18\/revisions\/164"}],"wp:attachment":[{"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/numa-bord.com\/miniblog\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}