Commit dec840b7 authored by xiabin's avatar xiabin

添加获取时间戳的url

parent a864b32d
......@@ -47,9 +47,9 @@ class AppAsset extends AssetBundle
* @param $path
* @return string
*/
public static function createImageUrl($path)
public static function getStaticUrl($path)
{
$path = '@web/assets' . $path;
$path = '@web/assets/' . $path;
$path = self::appendTimestamp($path);
return Yii::getAlias($path);
......
......@@ -11,7 +11,7 @@
<img
src="<?php echo Yii::$app->user->identity->avatar === '' ? \frontend\assets\AppAsset::createImageUrl('/img/avatar.jpg') : Yii::$app->user->identity->avatar ?>">
src="<?php echo Yii::$app->user->identity->avatar === '' ? \frontend\assets\AppAsset::getStaticUrl('img/avatar.jpg') : Yii::$app->user->identity->avatar ?>">
<p>
You may change the content of this page by modifying
the file <code><?= __FILE__; ?></code>.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment