Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

53 lines
1.4KB

  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. }