您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. namespace common\helpers;
  8. use yii ;
  9. class Url
  10. {
  11. public static function frontend()
  12. {
  13. $server_name = Yii::$app->getRequest()->serverName ;
  14. if($server_name == 'localhost')
  15. {
  16. return '../../frontend/web/' ;
  17. }
  18. elseif($server_name == 'www.laboiteapain.net' ||
  19. $server_name == 'boulanger.laboiteapain.net')
  20. {
  21. return 'http://www.laboiteapain.net/' ;
  22. }
  23. elseif($server_name == 'dev.laboiteapain.net' ||
  24. $server_name == 'boulanger-dev.laboiteapain.net')
  25. {
  26. return 'http://dev.laboiteapain.net/' ;
  27. }
  28. }
  29. public static function backend()
  30. {
  31. $server_name = Yii::$app->getRequest()->serverName ;
  32. if($server_name == 'localhost')
  33. {
  34. return '../../backend/web/' ;
  35. }
  36. elseif($server_name == 'www.laboiteapain.net' ||
  37. $server_name == 'boulanger.laboiteapain.net')
  38. {
  39. return 'http://boulanger.laboiteapain.net/' ;
  40. }
  41. elseif($server_name == 'dev.laboiteapain.net' ||
  42. $server_name == 'boulanger-dev.laboiteapain.net')
  43. {
  44. return 'http://boulanger-dev.laboiteapain.net/' ;
  45. }
  46. }
  47. }