GeneratedUrl.php 847 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace Drupal\Core;
  3. use Drupal\Core\Render\BubbleableMetadata;
  4. /**
  5. * Used to return generated URLs, along with associated bubbleable metadata.
  6. *
  7. * Note: not to be confused with \Drupal\Core\Url, which is for passing around
  8. * ungenerated URLs (typically route name + route parameters).
  9. */
  10. class GeneratedUrl extends BubbleableMetadata {
  11. /**
  12. * The string value of the URL.
  13. *
  14. * @var string
  15. */
  16. protected $generatedUrl = '';
  17. /**
  18. * Gets the generated URL.
  19. *
  20. * @return string
  21. */
  22. public function getGeneratedUrl() {
  23. return $this->generatedUrl;
  24. }
  25. /**
  26. * Sets the generated URL.
  27. *
  28. * @param string $generated_url
  29. * The generated URL.
  30. *
  31. * @return $this
  32. */
  33. public function setGeneratedUrl($generated_url) {
  34. $this->generatedUrl = $generated_url;
  35. return $this;
  36. }
  37. }