1 | <?php |
||
9 | class Menu extends BaseMenu implements Htmlable |
||
10 | { |
||
11 | use Macroable; |
||
12 | |||
13 | /** |
||
14 | * Set all relevant children active based on the current request's URL. |
||
15 | * |
||
16 | * /, /about, /contact => request to /about will set the about link active. |
||
17 | * |
||
18 | * /en, /en/about, /en/contact => request to /en won't set /en active if the |
||
19 | * request root is set to /en. |
||
20 | * |
||
21 | * @param string $requestRoot If the link's URL is an exact match with the |
||
22 | * request root, the link won't be set active. |
||
23 | * This behavior is to avoid having home links |
||
24 | * active on every request. |
||
25 | * |
||
26 | * @return $this |
||
27 | */ |
||
28 | public function setActiveFromRequest(string $requestRoot = '') |
||
32 | |||
33 | /** |
||
34 | * @param string $path |
||
35 | * @param string $text |
||
36 | * @param array $parameters |
||
37 | * @param bool|null $secure |
||
38 | * |
||
39 | * @return $this |
||
40 | */ |
||
41 | public function url(string $path, string $text, array $parameters = [], $secure = null) |
||
45 | |||
46 | /** |
||
47 | * @param string $action |
||
48 | * @param string $text |
||
49 | * @param array $parameters |
||
50 | * @param bool $absolute |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function action(string $action, string $text, array $parameters = [], bool $absolute = true) |
||
58 | |||
59 | /** |
||
60 | * @param string $name |
||
61 | * @param string $text |
||
62 | * @param array $parameters |
||
63 | * @param bool $absolute |
||
64 | * @param \Illuminate\Routing\Route|null $route |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function route(string $name, string $text, array $parameters = [], bool $absolute = true, $route = null) |
||
72 | |||
73 | /** |
||
74 | * Get content as a string of HTML. |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function toHtml() : string |
||
82 | } |
||
83 |