2009年9月4日星期五

[fw-mvc] Zend_View_Helper_BaseUrl documentation

Hello there,

I was reading documentation about the Zend_View_Helper_BaseUrl, and I read this :

<base href="<?php echo $this->baseUrl(); ?>" />

This example doesn't work at all, as (I'm pretty sure of this), base html tag needs an absolute Url to work.
For this example to work, I think something like :

$this->view->getHelper('BaseUrl')->setBaseUrl('http://' . $this->_request->getServer('SERVER_NAME') . '/' . $this->getFrontController()->getBaseUrl());

is needed before, in the controller.

Is the documentation wrong, or am I ?
Here is the link : http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.baseurl

Thanks,
Lucas

没有评论: