1 | <?php namespace Arcanedev\Breadcrumbs\Traits; |
||
11 | trait BreadcrumbsTrait |
||
12 | { |
||
13 | /* ------------------------------------------------------------------------------------------------ |
||
14 | | Properties |
||
15 | | ------------------------------------------------------------------------------------------------ |
||
16 | */ |
||
17 | /** |
||
18 | * Breadcrumbs container name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $breadcrumbsContainer = 'public'; |
||
23 | |||
24 | /** |
||
25 | * Breadcrumbs items collection. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | private $breadcrumbsItems = []; |
||
30 | |||
31 | /* ------------------------------------------------------------------------------------------------ |
||
32 | | Getters & Setters |
||
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() |
|
64 | |||
65 | /* ------------------------------------------------------------------------------------------------ |
||
66 | | Main Functions |
||
67 | | ------------------------------------------------------------------------------------------------ |
||
68 | */ |
||
69 | /** |
||
70 | * Register a breadcrumb. |
||
71 | * |
||
72 | * @param string $container |
||
73 | * @param array $item |
||
74 | */ |
||
75 | 4 | protected function registerBreadcrumbs($container, array $item = []) |
|
87 | |||
88 | /** |
||
89 | * Load all breadcrumbs. |
||
90 | */ |
||
91 | protected function loadBreadcrumbs() |
||
105 | |||
106 | /** |
||
107 | * Add breadcrumb. |
||
108 | * |
||
109 | * @param string $title |
||
110 | * @param string $url |
||
111 | * @param array $data |
||
112 | * |
||
113 | * @return self |
||
114 | */ |
||
115 | 4 | protected function addBreadcrumb($title, $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 self |
||
131 | */ |
||
132 | 4 | protected function addBreadcrumbRoute($title, $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