سؤال

I have been trying to develop a domain mapping service using Zend. So, I need to access the $_SERVER['HOST'] parameter during preDespatch , but If I var_dump($_SERVER) in a Plugin's preDispatch() function it does return NULL. Can someone tip off where to do that or how ?

هل كانت مفيدة؟

المحلول

If it's $_SERVER['HTTP_HOST'] that you want, you can try this:

public function preDispatch(Zend_Controller_Request_Abstract $request)
{
    $request->getHttpHost();
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top