Front controller object in zend framewok -
what diff. between below objects of front controller , how use it?
$this->bootstrap('frontcontroller'); $frontcontroller = $this->getresource('frontcontroller'); $front = zend_controller_front::getinstance(); what diff. between these 2 objects of front controller?
both
$frontcontroller = $this->getresource('frontcontroller'); and
$front = zend_controller_front::getinstance(); will return same instance of zend_controller_front. singleton, definition there can 1 instance of object. difference when execute
$this->bootstrap('frontcontroller'); you insuring bootstrap has executed front controller resource, zend_application_resource_frontcontroller default.
imo, use first example in bootstraps , resources, use latter everywhere else. both same instance of front controller, benefit first example lets bootstrap know front controller dependency.
Comments
Post a Comment