In Zend Framework 1, controller's had an
method, which was called after the controller was instantiated. The
reason for it was to encourage developers not to override the
constructor, and thus potentially break some of the functionality
(as a number of objects were injected via the constructor).
initialization.
But this feature is missing from ZF2; how can we accomplish this
sort of pattern?
init()
method, which was called after the controller was instantiated. The
reason for it was to encourage developers not to override the
constructor, and thus potentially break some of the functionality
(as a number of objects were injected via the constructor).
init()
was useful for doing additional objectinitialization.
class MyController extends Zend_Controller_Action
{
public function init()
{
// do some stuff!
}
}
sort of pattern?
DIGITAL JUICE
No comments:
Post a Comment
Thank's!