{"id":881,"date":"2015-01-08T08:49:31","date_gmt":"2015-01-08T08:49:31","guid":{"rendered":"https:\/\/intelligentbee.com\/blog\/?p=881"},"modified":"2024-02-13T14:52:46","modified_gmt":"2024-02-13T14:52:46","slug":"symfony2-how-to-get-the-label-for-a-specific-form-field-in-twig","status":"publish","type":"post","link":"https:\/\/intelligentbee.com\/blog\/symfony2-how-to-get-the-label-for-a-specific-form-field-in-twig\/","title":{"rendered":"Symfony2: How To Get The Label For A Specific Form Field In Twig"},"content":{"rendered":"<p>If you need to render the <code>label<\/code> value for a specific field without rendering the entire HTML <code>label<\/code> element (e. g. to use it for a placeholder), you can do it by using the <code>label<\/code> form variable:<\/p>\n<pre class=\"nums:false lang:xhtml decode:true\">{{ form_widget(form.fieldName, {'attr': {'placeholder\u2019: form.fieldName.vars.label}}) }}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you need to render the label value for a specific field without rendering the entire HTML label element (e. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"yst_prominent_words":[],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/posts\/881"}],"collection":[{"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/comments?post=881"}],"version-history":[{"count":3,"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/posts\/881\/revisions"}],"predecessor-version":[{"id":132373,"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/posts\/881\/revisions\/132373"}],"wp:attachment":[{"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/media?parent=881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/categories?post=881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/tags?post=881"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/intelligentbee.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}