Answer the question
In order to leave comments, you need to log in
How to deal with the method and its property?
There is a large class in which the following method is described:
/**
* Return the title of the page.
*
* @return string
*
* @since 11.1
*/
public function getDescription()
{
return $this->description;
}
/**
* Document description
*
* @var string
* @since 11.1
*/
public $description = '';
Answer the question
In order to leave comments, you need to log in
apparently the class works with the database and apparently the field type is varchar(200) :)
here is the class description the
property is set in the method
public function setDescription($description) {
$this->description = $description;
}
public function setMetaData($name, $content, $http_equiv = false, $sync = true) {
$name = strtolower($name);
if ($name == 'generator') {
$this->setGenerator($content);
} elseif ($name == 'description') {
$this->setDescription($content);
} else {
if ($http_equiv == true) {
$this->_metaTags['http-equiv'][$name] = $content;
// Syncing with HTTP-header
if($sync && strtolower($name) == 'content-type') {
$this->setMimeEncoding($content, false);
}
} else {
$this->_metaTags['standard'][$name] = $content;
}
}
}
It depends on what you are doing. If you have a component, then just call
$doc = JFactory::getDocument();
$doc->setMetaData('description', 'This is my description');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question