But if there is more than one method in that helper, how does it know which
method to call?

The code I have within my helper class for the direct method is this:

        public function direct($method){
                return $this->$method();
        }






Matthew Lurz wrote:
> 
> The documentation is correct. The direct method, if implemented in the
> action helper, will call a specific, default method in the helper. In the
> case of the FlashMessenger this is the addMessage method. So, calling
> $this->_helper->FlashMessenger('Some Message') will execute the direct
> method of the action helper. The direct method then calls addMessage().
> 
> Hope that helps.
> 
> 
> maxarbos wrote:
>> 
>> Hello,
>> 
>> I would like to pass a value to to a specific property inside of a helper
>> when I use it.
>> 
>> On page:
>> http://framework.zend.com/manual/en/zend.controller.actionhelpers.html
>> 
>> In the documentation is says this:
>> 
>> #Finally, most action helpers implement the method direct() which will
>> call a specific, default method in the helper. In the example of the
>> FlashMessenger, it calls addMessage():
>> 
>> $this->_helper->FlashMessenger('We did something in the last request');
>> 
>> // shouldnt this last line be:
>> $this->_helper->FlashMessenger('addMessage');  ? 
>> 
>> How do you get the message you want to add to 'addMessage' to that
>> method?  It would be great to be able to send a valu that is read into
>> the constructor.
>> 
>> 
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Action-Helper-tp19730400p19742543.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to