Hi All, 

Hoping someone can help me out here. 

I have just upgraded to ZF 1.5 and have discovered that Zend_Translate can
be made available to views by setting a registry entry and then using
$this->translate('langString') in my views. 

I have created some helpers that I include in my views using e.g. 

echo $this->myHelper(); 

In my Helper I have the following: 

class Zend_View_Helper_MyHelper 
{ 
  public function myHelper() 
  { 
    $s = "Hello World!"; 
    $s .= $this->translate('myString'); 

    return $; 
  } 
} 

When this is run I will get an error in my view stating: Call to undefined
method Zend_View_Helper_MyHelper::translate() ... 

Now, I can seem to fix this by changing the class line above to read: 

class Zend_View_Helper_MyHelper extends Zend_View 

My question is, is this correct or should I be going about things a
completely different way? 

Many thanks in advance. 

- Robert 


________________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email 
Security Service and the Macro 4 plc internal virus protection system.
________________________________________________________________________

Reply via email to