PHP Class Frontend\Core\Engine\Navigation

Inheritance: extends Frontend\Core\Engine\Base\Object
Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
getBackendURLForBlock ( string $action, string $module, string $language = null, array $parameters = null, boolean $urlencode = true ) : string Creates a Backend URL for a given action and module If you don't specify a language the current language will be used.
getFirstChildId ( integer $pageId ) : integer Get the first child for a given parent
getFooterLinks ( ) : array Get all footer links
getKeys ( string $language = null ) : array Get the page-keys
getNavigation ( string $language = null ) : array Get the navigation-items
getNavigationHTML ( string $type = 'page', integer $parentId, integer $depth = null, array $excludeIds = [], string $template = '/Core/Layout/Templates/Navigation.html.twig', integer $depthCounter = 1 ) : string Get navigation HTML
getPageId ( string $url, string $language = null ) : integer Get a menuId for an specified URL
getPageInfo ( integer $pageId ) : string Get more info about a page
getURL ( integer $pageId, string $language = null ) : string Get URL for a given pageId
getURLForBlock ( string $module, string $action = null, string $language = null, array $data = null ) : string Get the URL for a give module & action combination
getURLForExtraId ( integer $id, string $language = null ) : string Fetch the first direct link to an extra id
setExcludedPageIds ( mixed $pageIds ) This function lets you add ignored pages
setSelectedPageIds ( ) Set the selected page ids

Method Details

__construct() public method

public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface

getBackendURLForBlock() public static method

Creates a Backend URL for a given action and module If you don't specify a language the current language will be used.
public static getBackendURLForBlock ( string $action, string $module, string $language = null, array $parameters = null, boolean $urlencode = true ) : string
$action string The action to build the URL for.
$module string The module to build the URL for.
$language string The language to use, if not provided we will use the working language.
$parameters array GET-parameters to use.
$urlencode boolean Should the parameters be urlencoded?
return string

getFirstChildId() public static method

Get the first child for a given parent
public static getFirstChildId ( integer $pageId ) : integer
$pageId integer The pageID wherefore we should retrieve the first child.
return integer

getKeys() public static method

Get the page-keys
public static getKeys ( string $language = null ) : array
$language string The language wherefore the navigation should be loaded, if not provided we will load the language that was provided in the URL.
return array

getNavigation() public static method

Get the navigation-items
public static getNavigation ( string $language = null ) : array
$language string The language wherefore the keys should be loaded, if not provided we will load the language that was provided in the URL.
return array

getNavigationHTML() public static method

Get navigation HTML
public static getNavigationHTML ( string $type = 'page', integer $parentId, integer $depth = null, array $excludeIds = [], string $template = '/Core/Layout/Templates/Navigation.html.twig', integer $depthCounter = 1 ) : string
$type string The type of navigation the HTML should be build for.
$parentId integer The parentID to start of.
$depth integer The maximum depth to parse.
$excludeIds array PageIDs to be excluded.
$template string The template that will be used.
$depthCounter integer A counter that will hold the current depth.
return string

getPageId() public static method

Get a menuId for an specified URL
public static getPageId ( string $url, string $language = null ) : integer
$url string The URL wherefore you want a pageID.
$language string The language wherefore the pageID should be retrieved, if not provided we will load the language that was provided in the URL.
return integer

getPageInfo() public static method

Get more info about a page
public static getPageInfo ( integer $pageId ) : string
$pageId integer The pageID wherefore you want more information.
return string

getURL() public static method

Get URL for a given pageId
public static getURL ( integer $pageId, string $language = null ) : string
$pageId integer The pageID wherefore you want the URL.
$language string The language wherein the URL should be retrieved, if not provided we will load the language that was provided in the URL.
return string

getURLForBlock() public static method

Get the URL for a give module & action combination
public static getURLForBlock ( string $module, string $action = null, string $language = null, array $data = null ) : string
$module string The module wherefore the URL should be build.
$action string The specific action wherefore the URL should be build.
$language string The language wherein the URL should be retrieved, if not provided we will load the language that was provided in the URL.
$data array An array with keys and values that partially or fully match the data of the block. If it matches multiple versions of that block it will just return the first match.
return string

getURLForExtraId() public static method

Fetch the first direct link to an extra id
public static getURLForExtraId ( integer $id, string $language = null ) : string
$id integer The id of the extra.
$language string The language wherein the URL should be retrieved, if not provided we will load the language that was provided in the URL.
return string

setExcludedPageIds() public static method

This function lets you add ignored pages
public static setExcludedPageIds ( mixed $pageIds )
$pageIds mixed This can be a single page id or this can be an array with page ids.

setSelectedPageIds() public method

Set the selected page ids
public setSelectedPageIds ( )