Dennis, Methods that end in "Action" are supposed to be called automatically by the framework, not by you directly. You can create your own methods with any signature that you need. You don't have to suffix them with "Action" though; you can name them whatever you like.
On Tue, Jun 10, 2014 at 4:20 PM, dennis-fedco <[email protected]> wrote: > Generally looking at ZF2 examples, I generally see that methods called > xxxAction() contain no parameters. In fact I can't recall an example where > there is a parameter passed in such manner. Should one avoid using > parameter passing when calling Controller's Action methods, or is it pretty > much 'whatever you feel like doing goes'?*Example:* > class XXX extends AbstractActionController{ public function > indexAction() > { if (...) return $this->errorAction("My Error Message 1"); > else if (...) return $this->errorAction("My Error Message 2"); else > return new ViewModel(); } public function errorAction($message) > *//question about this parameter passing* { return new > ViewModel(array('content' => $message)); }} > > > > > -- > View this message in context: > http://zend-framework-community.634137.n4.nabble.com/Is-that-a-good-bad-neutral-practice-to-pass-variables-to-Controller-methods-tp4662131.html > Sent from the Zend Framework mailing list archive at Nabble.com.
