Actions

API15

JApplication/appendPathWay

From Joomla! Documentation

< API15:JApplication
Revision as of 17:09, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Deprecated functions Deprecated, use JPathWay->addItem() method instead.

[Edit Descripton]

Description:JApplication/appendPathWay

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;
}

[Edit See Also] SeeAlso:JApplication/appendPathWay

Examples

<CodeExamplesForm />