Case: you're developing a site with Zend Framework and need relative links to the folder the webapp is deployed in. I.e. mysite.com/folder
online and localhost:8080
under development.
The following works nice in controllers regardless of deployed location:
$this->_helper->redirector->gotoSimple($action, $controller, $module, $params);
And the following inside a viewscript, ie. index.phtml:
<a href="<?php echo $this->url(array('controller'=>'index', 'action' => 'index'), null, true); ?>">
But how do I get the correct basepath when linking to images or stylesheets? (in a layout.phtml file, for example):
<img src='<?php echo WHAT_TO_TYPE_HERE; ?>images/logo.png' />
and
$this->headLink()->appendStylesheet( WHAT_TO_TYPE_HERE . 'css/default.css');
WHAT_TO_TYPE_HERE
should be replaced with something that gives
<img src="/folder/images/logo.png />` on mysite.com and `<img src="/images/logo.png />
on localhost