API15

API15:JDocument/getMetaData

From Joomla! Documentation

Revision as of 22:17, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Gets a meta tag. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span>...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Gets a meta tag.

[Edit Descripton]

Template:Description:JDocument/getMetaData

Syntax

getMetaData($name, $http_equiv=false)
Parameter Name Default Value Description
$name $name Value of name or http-equiv tag
$http_equiv false $http_equiv META type "http-equiv" defaults to null

Returns

string public

Defined in

libraries/joomla/document/document.php

Importing

jimport( 'joomla.document.document' );

Source Body

function getMetaData($name, $http_equiv = false)
{
        $result = '';
        $name = strtolower($name);
        if($name == 'generator') { 
                $result = $this->getGenerator();
        } elseif($name == 'description') {
                $result = $this->getDescription();
        } else {
                if ($http_equiv == true) {
                        $result = @$this->_metaTags['http-equiv'][$name];
                } else {
                        $result = @$this->_metaTags['standard'][$name];
                }
        }
        return $result;
}

[Edit See Also] Template:SeeAlso:JDocument/getMetaData

Examples

<CodeExamplesForm />