PHP Класс Spatie\Menu\Laravel\Menu

Наследование: extends Spatie\Menu\Menu, implements Illuminate\Contracts\Support\Htmlable, use trait Illuminate\Support\Traits\Macroable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
action ( string $action, string $text, mixed $parameters = [], boolean $absolute = true )
actionIf ( boolean $condition, string $action, string $text, array $parameters = [], boolean $absolute = true )
actionIfCan ( string | array $authorization, string $action, string $text, array $parameters = [], boolean $absolute = true )
addIfCan ( string | array $authorization, Spatie\Menu\Item $item )
htmlIfCan ( string | array $authorization, string $html ) : Menu
linkIfCan ( string | array $authorization, string $url, string $text )
route ( string $name, string $text, mixed $parameters = [], boolean $absolute = true, Illuminate\Routing\Route | null $route = null )
routeIf ( boolean $condition, string $name, string $text, array $parameters = [], boolean $absolute = true, Illuminate\Routing\Route | null $route = null )
routeIfCan ( string | array $authorization, string $name, string $text, array $parameters = [], boolean $absolute = true, Illuminate\Routing\Route | null $route = null )
setActiveFromRequest ( string $requestRoot = '/' ) Set all relevant children active based on the current request's URL.
submenuIfCan ( string | array $authorization, callable | Menu | Spatie\Menu\Item $header, callable | Menu | null $menu = null )
toHtml ( ) : string
url ( string $path, string $text, mixed $parameters = [], boolean | null $secure = null )
urlIf ( boolean $condition, string $path, string $text, array $parameters = [], boolean | null $secure = null )
urlIfCan ( string | array $authorization, string $path, string $text, array $parameters = [], boolean | null $secure = null )
view ( string $name, array $data = [] )
viewIf ( $condition, string $name, array $data = null )
viewIfCan ( $authorization, string $name, array $data = null )

Защищенные методы

Метод Описание
parseSubmenuIfCanArgs ( $authorization, $args ) : array

Описание методов

action() публичный Метод

public action ( string $action, string $text, mixed $parameters = [], boolean $absolute = true )
$action string
$text string
$parameters mixed
$absolute boolean

actionIf() публичный Метод

public actionIf ( boolean $condition, string $action, string $text, array $parameters = [], boolean $absolute = true )
$condition boolean
$action string
$text string
$parameters array
$absolute boolean

actionIfCan() публичный Метод

public actionIfCan ( string | array $authorization, string $action, string $text, array $parameters = [], boolean $absolute = true )
$authorization string | array
$action string
$text string
$parameters array
$absolute boolean

addIfCan() публичный Метод

public addIfCan ( string | array $authorization, Spatie\Menu\Item $item )
$authorization string | array
$item Spatie\Menu\Item

htmlIfCan() публичный Метод

public htmlIfCan ( string | array $authorization, string $html ) : Menu
$authorization string | array
$html string
Результат Menu

linkIfCan() публичный Метод

public linkIfCan ( string | array $authorization, string $url, string $text )
$authorization string | array
$url string
$text string

parseSubmenuIfCanArgs() защищенный Метод

protected parseSubmenuIfCanArgs ( $authorization, $args ) : array
Результат array

route() публичный Метод

public route ( string $name, string $text, mixed $parameters = [], boolean $absolute = true, Illuminate\Routing\Route | null $route = null )
$name string
$text string
$parameters mixed
$absolute boolean
$route Illuminate\Routing\Route | null

routeIf() публичный Метод

public routeIf ( boolean $condition, string $name, string $text, array $parameters = [], boolean $absolute = true, Illuminate\Routing\Route | null $route = null )
$condition boolean
$name string
$text string
$parameters array
$absolute boolean
$route Illuminate\Routing\Route | null

routeIfCan() публичный Метод

public routeIfCan ( string | array $authorization, string $name, string $text, array $parameters = [], boolean $absolute = true, Illuminate\Routing\Route | null $route = null )
$authorization string | array
$name string
$text string
$parameters array
$absolute boolean
$route Illuminate\Routing\Route | null

setActiveFromRequest() публичный Метод

, /about, /contact => request to /about will set the about link active. en, /en/about, /en/contact => request to /en won't set /en active if the request root is set to /en.
public setActiveFromRequest ( string $requestRoot = '/' )
$requestRoot string If the link's URL is an exact match with the request root, the link won't be set active. This behavior is to avoid having home links active on every request.

submenuIfCan() публичный Метод

public submenuIfCan ( string | array $authorization, callable | Menu | Spatie\Menu\Item $header, callable | Menu | null $menu = null )
$authorization string | array
$header callable | Spatie\Menu\Menu | Spatie\Menu\Item
$menu callable | Spatie\Menu\Menu | null

toHtml() публичный Метод

public toHtml ( ) : string
Результат string

url() публичный Метод

public url ( string $path, string $text, mixed $parameters = [], boolean | null $secure = null )
$path string
$text string
$parameters mixed
$secure boolean | null

urlIf() публичный Метод

public urlIf ( boolean $condition, string $path, string $text, array $parameters = [], boolean | null $secure = null )
$condition boolean
$path string
$text string
$parameters array
$secure boolean | null

urlIfCan() публичный Метод

public urlIfCan ( string | array $authorization, string $path, string $text, array $parameters = [], boolean | null $secure = null )
$authorization string | array
$path string
$text string
$parameters array
$secure boolean | null

view() публичный Метод

public view ( string $name, array $data = [] )
$name string
$data array

viewIf() публичный Метод

public viewIf ( $condition, string $name, array $data = null )
$condition
$name string
$data array

viewIfCan() публичный Метод

public viewIfCan ( $authorization, string $name, array $data = null )
$name string
$data array