How to include map.php as a source of an img tag
I am displaying a map in my page, in static PHP it is something like (img src="action/map.php")
as all the code regarding map is in map.php
.
In Symfony, I am getting confused where to put my map.php
fil开发者_如何学Ce and how to include that file as a source of an img tag.
you could get it done with e.g. an action:
public function executeShowmap(){
$this->getResponse()->setHttpHeader('Content-type', 'image/jpeg');
$this->getResponse()->setContent(file_get_contents($filename));
return sfView::NONE;
}
and in the view:
img src="<?php echo url_for('module/showmap'); ?>"
精彩评论