Support Joomla!

references:joomla.framework:document:jdocumenthtml-addfavicon

Table of Contents

addFavicon

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

Adds a shortcut icon (favicon). This adds a link to the icon shown in the favorites list or on the left of the url in the address bar. Some browsers display it on the tab, as well.

Syntax

void addFavicon ( $href, $type, $relation )

$href string is a string containing the link that is being related.
$type string this is a link containing the file type of the icon. This parameter is optional and if omitted defaults to ‘image/x-icon’.
$relation string this is a string containing the relation of link. This parameter is optional and if omitted defaults to ‘shortcut icon’.

Examples

Set the favourite icon to use for the document.

Example

global $mainframe;

$document =& JFactory::getDocument();
$document->addFavicon( "http://dev.joomla.org/images/favicon.ico" );

adds the following code to the head block:

Result

<link href="http://dev.joomla.org/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
 
references/joomla.framework/document/jdocumenthtml-addfavicon.txt (682 views) · Last modified: 2007/08/15 15:04