1 | <?php namespace Arcanedev\Breadcrumbs; |
||
9 | trait HasBreadcrumbs |
||
10 | { |
||
11 | /* ----------------------------------------------------------------- |
||
12 | | Properties |
||
13 | | ----------------------------------------------------------------- |
||
14 | */ |
||
15 | |||
16 | /** |
||
17 | * Breadcrumbs container name. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | protected $breadcrumbsContainer = 'public'; |
||
22 | |||
23 | /** |
||
24 | * Breadcrumbs items collection. |
||
25 | * |
||
26 | * @var array |
||
27 | */ |
||
28 | private $breadcrumbsItems = []; |
||
29 | |||
30 | /* ----------------------------------------------------------------- |
||
31 | | Getters & Setters |
||
32 | | ----------------------------------------------------------------- |
||
33 | */ |
||
34 | |||
35 | /** |
||
36 | * Set breadcrumbs container name. |
||
37 | * |
||
38 | * @param string $name |
||
39 | * |
||
40 | * @return self |
||
41 | */ |
||
42 | 4 | protected function setBreadcrumbsContainer($name) |
|
48 | |||
49 | /** |
||
50 | * Get the breadcrumbs home item (root). |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | 4 | protected function getBreadcrumbsHomeItem() |
|
62 | |||
63 | /* ----------------------------------------------------------------- |
||
64 | | Main Functions |
||
65 | | ----------------------------------------------------------------- |
||
66 | */ |
||
67 | |||
68 | /** |
||
69 | * Register a breadcrumb. |
||
70 | * |
||
71 | * @param string $container |
||
72 | * @param array $item |
||
73 | */ |
||
74 | 4 | protected function registerBreadcrumbs($container, array $item = []) |
|
86 | |||
87 | /** |
||
88 | * Load all breadcrumbs. |
||
89 | */ |
||
90 | 4 | protected function loadBreadcrumbs() |
|
102 | |||
103 | /** |
||
104 | * Add breadcrumb. |
||
105 | * |
||
106 | * @param string $title |
||
107 | * @param string $url |
||
108 | * @param array $data |
||
109 | * |
||
110 | * @return self |
||
111 | */ |
||
112 | 4 | protected function addBreadcrumb($title, $url = '', array $data = []) |
|
118 | |||
119 | /** |
||
120 | * Add breadcrumb with route. |
||
121 | * |
||
122 | * @param string $title |
||
123 | * @param string $route |
||
124 | * @param array $parameters |
||
125 | * @param array $data |
||
126 | * |
||
127 | * @return self |
||
128 | */ |
||
129 | 4 | protected function addBreadcrumbRoute($title, $route, array $parameters = [], array $data = []) |
|
133 | } |
||
134 |
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