![]() ![]() You can define a param like this: Yii::$app->params = realpath(Yii::$app->basePath). Supposing you have a writable “uploads” folder in your application: You may store the image using \Yii::$app->basePath and show it using \Yii::$app->request->BaseUrl \Yii::$app->request->BaseUrl will give like localhost\advanced\backend\web\ \Yii::$app->basePath will give like D:\xampp\htdocs\advanced\backend. My installation is at D:\xampp\htdocs\advanced Now to get path of your root (in my case its D:\wamp\www\yiistore2) directory you can use below code in any php file. Paste below code before return realpath(dirname(_FILE_).'/././')) Īfter inserting above code in params-local.php file your file should look like this. Open file D:\wamp\www\yiistore2\common\config\params-local.php
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |