Factory.php 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. namespace Illuminate\Contracts\View;
  3. interface Factory
  4. {
  5. /**
  6. * Determine if a given view exists.
  7. *
  8. * @param string $view
  9. * @return bool
  10. */
  11. public function exists($view);
  12. /**
  13. * Get the evaluated view contents for the given path.
  14. *
  15. * @param string $path
  16. * @param array $data
  17. * @param array $mergeData
  18. * @return \Illuminate\Contracts\View\View
  19. */
  20. public function file($path, $data = [], $mergeData = []);
  21. /**
  22. * Get the evaluated view contents for the given view.
  23. *
  24. * @param string $view
  25. * @param array $data
  26. * @param array $mergeData
  27. * @return \Illuminate\Contracts\View\View
  28. */
  29. public function make($view, $data = [], $mergeData = []);
  30. /**
  31. * Add a piece of shared data to the environment.
  32. *
  33. * @param array|string $key
  34. * @param mixed $value
  35. * @return mixed
  36. */
  37. public function share($key, $value = null);
  38. /**
  39. * Register a view composer event.
  40. *
  41. * @param array|string $views
  42. * @param \Closure|string $callback
  43. * @return array
  44. */
  45. public function composer($views, $callback);
  46. /**
  47. * Register a view creator event.
  48. *
  49. * @param array|string $views
  50. * @param \Closure|string $callback
  51. * @return array
  52. */
  53. public function creator($views, $callback);
  54. /**
  55. * Add a new namespace to the loader.
  56. *
  57. * @param string $namespace
  58. * @param string|array $hints
  59. * @return $this
  60. */
  61. public function addNamespace($namespace, $hints);
  62. /**
  63. * Replace the namespace hints for the given namespace.
  64. *
  65. * @param string $namespace
  66. * @param string|array $hints
  67. * @return $this
  68. */
  69. public function replaceNamespace($namespace, $hints);
  70. }