Class Navigation
License: GNU General Public License v2.0 only **********************************************************************************************
Brief:
Handle the navigation within a module and could create a html navigation bar
This class stores every url that you add to the object in a stack. From there it's possible to return the last called url or a previous url. This can be used to allow a navigation within a module. It's also possible to create a html navigation bar. Therefore you should add a url and a link text to the object everytime you submit a url.
Class: Navigation
Code:
// start the navigation in a module (the object $gNavigation is created in common.php) $gNavigation->addStartUrl('http://www.example.com/index.php', 'Example-Module');
// add a new url from another page within the same module $gNavigation->addUrl('http://www.example.com/addentry.php', 'Add Entry');
// optional you can now create the html navigation bar $gNavigation->getHtml();
// if you want to remove the last entry from the stack $gNavigation->deleteLastUrl(); @endcode
Code:
// show a navigation bar in your html code
...
getHtmlNavigationBar('id-my-navigation'); ?>
... @endcode
Par: Example 1
Par: Example 2
Located at navigation.php
Methods summary
public
|
|
public
|
#
addStartUrl( string $url, string $text = null, string $icon = null )
Initialize the stack and adds a new url to the navigation stack. If a html navigation bar should be created later than you should fill the text and maybe the icon. |
public
boolean
|
#
addUrl( string $url, string $text = null, string $icon = null )
Add a new url to the navigation stack. If a html navigation bar should be created later than you should fill the text and maybe the icon. Before the url will be added to the stack the method checks if the current url was already added to the url. |
public
|
|
public
integer
|
|
public
string[]
|
|
public
string
|
#
getHtmlBackButton( string $id = 'adm-navigation-back' )
Returns html code that contain a link back to the previous url. |
public
string
|
#
getHtmlNavigationBar( string $id = 'adm-navigation-bar' )
Returns html code that contain links to all previous added urls from the stack. The output will look like: @n FirstPage > SecondPage > ThirdPage ...@n The last page of this list is always the current page. |
public
string|null
|
#
getPreviousUrl( )
Get the previous url from the stack. This is not the last url that was added to the stack! |
public
string|null
|