Yii :: app() - > baseUrl无效

Why

<a id="tray-button"><img id="tray-arrow" src="http://localhost/ric/slideshow/img/button-tray-up.png"/></a>

is working but not this

<a id="tray-button"><img id="tray-arrow" src=<?php Yii::app()->baseUrl.'/slideshow/img/button-tray-up.png'?>/></a>

Provided http://localhost/ric -> is my webroot.

Here is the basepath configuration from my main.php

'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

You need to "echo" the baseUrl

<a id="tray-button">
  <img id="tray-arrow" src="<?php echo Yii::app()->baseUrl; ?>/slideshow/img/button-tray-up.png" />
</a>

Works like a charm! I have been searching everywhere for this code. I knew about the "echo" bit but I did not know which function to use. My code now reads

< img src="< ?php echo Yii::app()->baseUrl; ?>/images/MyPicture.jpg" alt="MyPicture logo" />