Support Joomla!

references:joomla.framework:document:jdocumenthtml-addheadlink

Table of Contents

addHeadLink

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Document Class JDocumentHTML Method addHeadLink Reference addHeadLink() Never Work in Progress

Adds <link> tags to the head of the document. $relType defaults to ‘rel’ as it is the most common relation type used. ‘rev’ refers to reverse relation. ‘rel’ indicates normal, forward relation. Typical tag: <link href=”index.php” rel=”Start”>.

Syntax

void addHeadLink ( $href, $relation, $relType, $attribs, $attributes )

$href string is a string containing the link that is being related.
$relation string is a string containing the relation of the link.
$relType string is a string containing the relation type attribute. This can be either rel (normal, forward relation) or rev (reverse relation). This parameter is optional and if omitted defaults to ‘rel’.
$attributes array is an associative array of the remaining attributes. This parameter is optional, and if omitted defaults to an empty array. These attributes are appended to the end of the head link tag.

Examples

Add a head link to the page.

Example

global $mainframe;

$document =& JFactory::getDocument();
$document->addHeadLink( "http://www.gnu.org/copyleft/fdl.html", 'copyright', 'rel', array( 'charset' => 'UTF-8' ) );

adds the following code to the head block:

Result

<link href="http://www.gnu.org/copyleft/fdl.html" rel="copyright" charset="UTF-8" />
 
references/joomla.framework/document/jdocumenthtml-addheadlink.txt (713 views) · Last modified: 2007/08/15 14:53