PHP 클래스 Spatie\Menu\Laravel\Menu

상속: extends Spatie\Menu\Menu, implements Illuminate\Contracts\Support\Htmlable, use trait Illuminate\Support\Traits\Macroable
파일 보기 프로젝트 열기: spatie/laravel-menu 1 사용 예제들

공개 메소드들

메소드 설명
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