0
我在我的yii2項目中有前端,後端和API。我已經從url中刪除了前端/網絡。 http://www.yiiframework.com/wiki/755/how-to-hide-frontend-web-in-url-addresses-on-apache/ 但我的整個圖像越來越找不到錯誤在後臺和frontend.I現在面臨的問題給予path.I曾嘗試下面的代碼 在PARAMS-local.phpyii2中的圖像路徑問題
Yii ::setAlias('@source', 'http://example.com');
在前端/ index.php文件
<body style="background-image:url(.<?Yii ::getAlias('@source') ?>.'/images/media-bg.jpg');background-attachment:fixed;">
仍然得到錯誤(#2)。請幫助
首先您設置了別名,並且您可以在任何需要的地方使用別名。所以這個<?Yii :: setAlias('@ source')?>將會是<?Yii :: getAlias('@ source')?> –
請指出你得到的錯誤 – Chinmay
我得到錯誤(#2)內部服務器錯誤 – user3312884