Oh... I see...
I supposes you can move the two methods from the controller to the service as static ones and obtain it using those methods.
I'm out of ideas...
Regards
2008/10/2 Piotr Czachur <zimnyx@gmail.com>
--
My place to share my ideas:
http://vladev.blogspot.com
http://carutoo.com
I supposes you can move the two methods from the controller to the service as static ones and obtain it using those methods.
I'm out of ideas...
Regards
2008/10/2 Piotr Czachur <zimnyx@gmail.com>
Emil,
Thanks for fast reply.
2008/10/2 Емил Иванов / Emil Ivanov <emil.vladev@gmail.com>:
> Hi Piotr,Controller object is created inside
>
> You can inject it in your controller:
>
> class ServiceController extends Zend_Controller_Action
> {
> protected $_service;
> public function setService($service)
> {
> $this->_service = $service;
> }
>
> public function getService()
> {
> return $this->_service;
> }
> }
>
> Use the setter to replace the service object and always obtain the service
> in your controller using the getter.
Zend_Controller_Dispatcher_Standard::dispatch() method, so... in which
place do you want to call ->setService() ?
My whole post was rather how can I reach this controller during
dispatch(), and inject mocked object $service into it, not about
setters/getters and mock. Sorry if I wasn't clear.
Cheers,
Piotr Czachur
--
My place to share my ideas:
http://vladev.blogspot.com
http://carutoo.com
没有评论:
发表评论