Context.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\View\Asset\File;
  7. use Magento\Framework\View\Asset;
  8. /**
  9. * A basic path context for assets that includes a directory path
  10. */
  11. class Context implements Asset\ContextInterface
  12. {
  13. /**
  14. * @var string
  15. */
  16. private $baseUrl;
  17. /**
  18. * @var string
  19. */
  20. private $baseDir;
  21. /**
  22. * @var string
  23. */
  24. private $path;
  25. /**
  26. * @param string $baseUrl
  27. * @param string $baseDirType
  28. * @param string $contextPath
  29. */
  30. public function __construct($baseUrl, $baseDirType, $contextPath)
  31. {
  32. $this->baseUrl = $baseUrl;
  33. $this->baseDir = $baseDirType;
  34. $this->path = $contextPath;
  35. }
  36. /**
  37. * {@inheritdoc}
  38. */
  39. public function getPath()
  40. {
  41. return $this->path;
  42. }
  43. /**
  44. * {@inheritdoc}
  45. */
  46. public function getBaseUrl()
  47. {
  48. return $this->baseUrl;
  49. }
  50. /**
  51. * Get type of base directory
  52. *
  53. * @return string
  54. */
  55. public function getBaseDirType()
  56. {
  57. return $this->baseDir;
  58. }
  59. }