1 | <?php |
||
12 | trait HasBreadcrumbs |
||
13 | { |
||
14 | /* ----------------------------------------------------------------- |
||
15 | | Properties |
||
16 | | ----------------------------------------------------------------- |
||
17 | */ |
||
18 | |||
19 | /** |
||
20 | * Breadcrumbs container name. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $breadcrumbsContainer = 'public'; |
||
25 | |||
26 | /** |
||
27 | * Breadcrumbs items collection. |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | private $breadcrumbsItems = []; |
||
32 | |||
33 | /* ----------------------------------------------------------------- |
||
34 | | Getters & Setters |
||
35 | | ----------------------------------------------------------------- |
||
36 | */ |
||
37 | |||
38 | /** |
||
39 | * Set breadcrumbs container name. |
||
40 | * |
||
41 | * @param string $name |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | 6 | protected function setBreadcrumbsContainer(string $name) |
|
51 | |||
52 | /** |
||
53 | * Get the breadcrumbs home item (root). |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | 6 | protected function getBreadcrumbsHomeItem(): array |
|
65 | |||
66 | /* ----------------------------------------------------------------- |
||
67 | | Main Functions |
||
68 | | ----------------------------------------------------------------- |
||
69 | */ |
||
70 | |||
71 | /** |
||
72 | * Register a breadcrumb. |
||
73 | * |
||
74 | * @param string $container |
||
75 | * @param array $item |
||
76 | */ |
||
77 | 6 | protected function registerBreadcrumbs(string $container, array $item = []): void |
|
89 | |||
90 | /** |
||
91 | * Load all breadcrumbs. |
||
92 | */ |
||
93 | 6 | protected function loadBreadcrumbs(): void |
|
105 | |||
106 | /** |
||
107 | * Add breadcrumb. |
||
108 | * |
||
109 | * @param string $title |
||
110 | * @param string $url |
||
111 | * @param array $data |
||
112 | * |
||
113 | * @return $this |
||
114 | */ |
||
115 | 6 | protected function addBreadcrumb(string $title, string $url = '', array $data = []) |
|
121 | |||
122 | /** |
||
123 | * Add breadcrumb with route. |
||
124 | * |
||
125 | * @param string $title |
||
126 | * @param string $route |
||
127 | * @param array $parameters |
||
128 | * @param array $data |
||
129 | * |
||
130 | * @return $this |
||
131 | */ |
||
132 | 6 | protected function addBreadcrumbRoute(string $title, string $route, array $parameters = [], array $data = []) |
|
136 | } |
||
137 |
It seems like you are assigning to a variable which was imported through a
use
statement which was not imported by reference.For clarity, we suggest to use a different name or import by reference depending on whether you would like to have the change visibile in outer-scope.
Change not visible in outer-scope
Change visible in outer-scope