JDocument/getMetaData: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 57: | Line 57: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=getMetaData | category=getMetaData | ||
category=JDocument | category=JDocument | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 01:31, 25 March 2017
Description
Gets a meta tag.
<! removed transcluded page call, red link never existed >
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;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples