獲取Yii2 常用 路徑 目錄 url


下面這些別名都是在Yii2里面系統定義的,可以直接拿來就用

  • '@yii' =>
    •       '@yii/swiftmailer' => string 'C:\wamp\www\advanced\vendor/yiisoft/yii2-swiftmailer' (length=52)
    •       '@yii/gii' => string 'C:\wamp\www\advanced\vendor/yiisoft/yii2-gii' (length=44)
    •       '@yii/faker' => string 'C:\wamp\www\advanced\vendor/yiisoft/yii2-faker' (length=46)
    •       '@yii/debug' => string 'C:\wamp\www\advanced\vendor/yiisoft/yii2-debug' (length=46)
    •       '@yii/codeception' => string 'C:\wamp\www\advanced\vendor/yiisoft/yii2-codeception' (length=52)
    •       '@yii/bootstrap' => string 'C:\wamp\www\advanced\vendor/yiisoft/yii2-bootstrap' (length=50)
    •       '@yii' => string 'C:\wamp\www\advanced\vendor\yiisoft\yii2' (length=40)
  •   '@app' => string 'C:\wamp\www\advanced\frontend' (length=29)
  •   '@vendor' => string 'C:\wamp\www\advanced/vendor' (length=27)
  •   '@bower' => string 'C:\wamp\www\advanced/vendor\bower' (length=33)
  •   '@npm' => string 'C:\wamp\www\advanced/vendor\npm' (length=31)
  •   '@runtime' => string 'C:\wamp\www\advanced\frontend\runtime' (length=37)
  •   '@webroot' => string 'C:/wamp/www/advanced/frontend/web' (length=33)
  •   '@web' => string '/advanced/frontend/web' (length=22)


其中最常用的別名有

  • @app
  • @vendor
  • @runtime
  • @webroot
  • @web


而且可以看到除了@web別名是url外,其它的都是物理路徑


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM