From 10ff7bdd62ea9cadfa1361a1b307b918fab4f39e Mon Sep 17 00:00:00 2001 From: Pierre-Louis LAUNAY Date: Thu, 14 Oct 2010 12:00:47 +0200 Subject: [PATCH 1/3] Fixes a fatal error in file Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget/textarea_field.php : Call to undefined method Symfony\Bundle\FrameworkBundle\Templating\Form\Field::getDisplayedData() --- src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php index 052ddce0b5224..f1c503e0f5f76 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php @@ -49,14 +49,14 @@ public function widget(array $attributes = array(), $template = null) } return $this->engine->render($template, array( - 'field' => $this, + 'field' => $this->field, 'origin' => $this->field, 'attributes' => array_merge($this->field->getAttributes(), $attributes), 'generator' => $this->generator, )); } - public function label($label, $template = null) + public function label($label = false, $template = null) { if (null === $template) { $template = 'FrameworkBundle:Form:label.php'; From b25c7f5251c804711a72e01ab2f37093eb50bd64 Mon Sep 17 00:00:00 2001 From: Pierre-Louis LAUNAY Date: Mon, 25 Oct 2010 16:53:06 +0200 Subject: [PATCH 2/3] Remove my fix --- src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php index 5f78cf7879f03..8f01c47fc17c4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php @@ -52,7 +52,7 @@ public function widget(array $attributes = array(), $template = null) } return $this->engine->render($template, array( - 'field' => $this->field, + 'field' => $this, 'origin' => $this->field, 'attributes' => array_merge($this->field->getAttributes(), $attributes), 'generator' => $this->generator, From 7db57c57e0c8fa8efac79770359c7fab81be7754 Mon Sep 17 00:00:00 2001 From: Pierre-Louis LAUNAY Date: Tue, 26 Oct 2010 18:10:46 +0200 Subject: [PATCH 3/3] Adds a new variable "origin" in the return value of method label() in order customize the rendering of the tag "label" based on the properties of the field --- .../Bundle/FrameworkBundle/Templating/Form/Field.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php index 8f01c47fc17c4..afb222630b986 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Form/Field.php @@ -66,10 +66,11 @@ public function label($label = false, $template = null) } return $this->engine->render($template, array( - 'field' => $this, - 'id' => $this->field->getId(), - 'key' => $this->field->getKey(), - 'label' => $label ? $label : ucfirst(strtolower(str_replace('_', ' ', $this->field->getKey()))) + 'field' => $this, + 'origin' => $this->field, + 'id' => $this->field->getId(), + 'key' => $this->field->getKey(), + 'label' => $label ? $label : ucfirst(strtolower(str_replace('_', ' ', $this->field->getKey()))) )); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy