UrlGenerator.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace Illuminate\Contracts\Routing;
  3. interface UrlGenerator
  4. {
  5. /**
  6. * Get the current URL for the request.
  7. *
  8. * @return string
  9. */
  10. public function current();
  11. /**
  12. * Generate an absolute URL to the given path.
  13. *
  14. * @param string $path
  15. * @param mixed $extra
  16. * @param bool $secure
  17. * @return string
  18. */
  19. public function to($path, $extra = [], $secure = null);
  20. /**
  21. * Generate a secure, absolute URL to the given path.
  22. *
  23. * @param string $path
  24. * @param array $parameters
  25. * @return string
  26. */
  27. public function secure($path, $parameters = []);
  28. /**
  29. * Generate the URL to an application asset.
  30. *
  31. * @param string $path
  32. * @param bool $secure
  33. * @return string
  34. */
  35. public function asset($path, $secure = null);
  36. /**
  37. * Get the URL to a named route.
  38. *
  39. * @param string $name
  40. * @param mixed $parameters
  41. * @param bool $absolute
  42. * @return string
  43. *
  44. * @throws \InvalidArgumentException
  45. */
  46. public function route($name, $parameters = [], $absolute = true);
  47. /**
  48. * Get the URL to a controller action.
  49. *
  50. * @param string $action
  51. * @param mixed $parameters
  52. * @param bool $absolute
  53. * @return string
  54. */
  55. public function action($action, $parameters = [], $absolute = true);
  56. /**
  57. * Set the root controller namespace.
  58. *
  59. * @param string $rootNamespace
  60. * @return $this
  61. */
  62. public function setRootControllerNamespace($rootNamespace);
  63. }