static link in Zend Framework layout

Posted on 2009-02-13
Medium Priority
Last Modified: 2013-11-10
How do I get a static link to my static file in Zend layout.phtml? I'm a newbie in Zend.

I mean that I have to create something like in the snippet. What do I put instead of "...."?
<img src='<?= $this->url (....) ?>' />

Open in new window

Question by:technoparkcorp
LVL 49

Accepted Solution

Roonaan earned 2000 total points
ID: 23644706

You can use the front controller to get the base url for your application. Then you can append to your images quite easily.

<img src="<?php echo Zend_Controller_Front::getInstance()->getBaseUrl();?>/images/test.gif" />

Kind regards


Expert Comment

ID: 23660009
you can just set it to the url if you like such as <img src='/images/icon.gif" />

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question