| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Document |
JDocumentHTML |
addHeadLink |
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”>.
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. |
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" />