JApplication/appendPathWay: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m clean up |
||
| Line 2: | Line 2: | ||
Deprecated functions Deprecated, use JPathWay->addItem() method instead. | Deprecated functions Deprecated, use JPathWay->addItem() method instead. | ||
<! removed transcluded page call, red link never existed > | <! removed transcluded page call, red link never existed > | ||
| Line 71: | Line 69: | ||
</source> | </source> | ||
<! removed transcluded page call, red link never existed > | <! removed transcluded page call, red link never existed > | ||
Revision as of 13:30, 24 March 2017
Description
Deprecated functions Deprecated, use JPathWay->addItem() method instead.
<! removed transcluded page call, red link never existed >
Syntax
appendPathWay($name, $link=null)
| Parameter Name | Default Value | Description |
|---|---|---|
| $name | ||
| $link | null |
Defined in
libraries/joomla/application/application.php
Importing
jimport( 'joomla.application.application' );
Source Body
function appendPathWay( $name, $link = null )
{
/*
* To provide backward compatability if no second parameter is set
* set it to null
*/
if ($link == null) {
$link = '';
}
$pathway =& $this->getPathway();
if( defined( '_JLEGACY' ) && $link == '' )
{
$matches = array();
$links = preg_match_all ( '/<a[^>]+href="([^"]*)"[^>]*>([^<]*)<\/a>/ui', $name, $matches, PREG_SET_ORDER );
foreach( $matches AS $match) {
// Add each item to the pathway object
if( !$pathway->addItem( $match[2], $match[1] ) ) {
return false;
}
}
return true;
}
else
{
// Add item to the pathway object
if ($pathway->addItem($name, $link)) {
return true;
}
}
return false;
}
<! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />