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