You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UrlGenerator.php 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. * Get the URL for the previous request.
  13. *
  14. * @param mixed $fallback
  15. * @return string
  16. */
  17. public function previous($fallback = false);
  18. /**
  19. * Generate an absolute URL to the given path.
  20. *
  21. * @param string $path
  22. * @param mixed $extra
  23. * @param bool $secure
  24. * @return string
  25. */
  26. public function to($path, $extra = [], $secure = null);
  27. /**
  28. * Generate a secure, absolute URL to the given path.
  29. *
  30. * @param string $path
  31. * @param array $parameters
  32. * @return string
  33. */
  34. public function secure($path, $parameters = []);
  35. /**
  36. * Generate the URL to an application asset.
  37. *
  38. * @param string $path
  39. * @param bool $secure
  40. * @return string
  41. */
  42. public function asset($path, $secure = null);
  43. /**
  44. * Get the URL to a named route.
  45. *
  46. * @param string $name
  47. * @param mixed $parameters
  48. * @param bool $absolute
  49. * @return string
  50. *
  51. * @throws \InvalidArgumentException
  52. */
  53. public function route($name, $parameters = [], $absolute = true);
  54. /**
  55. * Get the URL to a controller action.
  56. *
  57. * @param string|array $action
  58. * @param mixed $parameters
  59. * @param bool $absolute
  60. * @return string
  61. */
  62. public function action($action, $parameters = [], $absolute = true);
  63. /**
  64. * Set the root controller namespace.
  65. *
  66. * @param string $rootNamespace
  67. * @return $this
  68. */
  69. public function setRootControllerNamespace($rootNamespace);
  70. }