JApplication/appendPathWay: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 73: | Line 73: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=appendPathWay | category=appendPathWay | ||
category=JApplication | category=JApplication | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 00:15, 25 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
Code Examples