Correction sur le formulaire
authorSébastien CHAZALLET <s.chazallet@gmail.com>
Fri, 16 Nov 2012 15:03:58 +0000 (16:03 +0100)
committerSébastien CHAZALLET <s.chazallet@gmail.com>
Fri, 16 Nov 2012 15:03:58 +0000 (16:03 +0100)
vendor/zf2biz/Custom/Form/AbstractForm.php

index d09c246..48e12cc 100644 (file)
@@ -64,8 +64,13 @@ abstract class AbstractForm extends Form implements TranslatorAwareInterface
 
     public function setTranslator(Translator $translator = null, $textDomain = null)
     {
-        $this->_translator = $translator;
-       $this->_textDomain = $textDomain;
+        if ($translator) {
+            $this->_translator = $translator;
+            $this->_translator_enabled = true;
+        }
+        if ($textDomain) {
+            $this->_textDomain = $textDomain;
+        }
     }
 
     public function getTranslator()
@@ -80,7 +85,7 @@ abstract class AbstractForm extends Form implements TranslatorAwareInterface
 
     public function setTranslatorEnabled($enabled = true)
     {
-        $this->_translator_enabled = $enabed;
+        $this->_translator_enabled = $enabled;
     }
 
     public function isTranslatorEnabled()
@@ -90,7 +95,7 @@ abstract class AbstractForm extends Form implements TranslatorAwareInterface
 
     public function setTranslatorTextDomain($textDomain = 'default')
     {
-       $this->_textDomain = $textDomain;
+        $this->_textDomain = $textDomain;
     }
 
     public function getTranslatorTextDomain()