是否有办法从一个服务级调派行动助手?
我有以下助手:
class Helper_Host extends Zend_Controller_Action_Helper_Abstract
{
/**
* Return Hosturl with path
*
* @return string Hostname
*/
public function direct()
{
$front = Zend_Controller_Front::getInstance();
$host = http:// . $_SERVER[ HTTP_HOST ];
$host .= $front->getBaseUrl() . / ;
return (string) $host;
}
}
现在,我想要从“My_service_XYZ”那里获得东道方名,但ScaticHelper没有做例外的工作。
class My_Service_XYZ {
public function test()
{
$h = Zend_Controller_Action_HelperBroker::getStaticHelper( Host );
return $h->host(); // not working..
}
}