Webocreation

Thursday, April 21, 2011

Document library functions




Document library functions in the opencart
setTitle($title):
The title of the page is set with the call of $this->document->setTitle($title); where $title is the parameter which take the string.
public function setTitle($title) {
$this->title = $title;
}
getTitle():
$this->document->setTitle() means the title is get and set to <title> of the document
public function getTitle() {
return $this->title;
}
setDescription($description):
$this->document->setDescription($description) which set the description of the page.
public function setDescription($description) {
$this->description = $description;
}
getDescription():
$this->document->getDescription() gives us the description of the document which is embedded in the <head> of the document
public function getDescription() {
return $this->description;
}
setKeywords($keywords):
$this->document->setKeywords($keywords) set the SEO keywords
public function setKeywords($keywords) {
$this->keywords = $keywords;
}
getKeywords():
$this->document->getKeywords() get the keywords which are set for the page.
public function getKeywords() {
return $this->keywords;
}
setBase($base):
$this->document->setBase($base) the base url for the document. If we need different base url then we have to set it.
public function setBase($base) {
$this->base = $base;
}
getBase():
Retrieve the set base url
public function getBase() {
return $this->base;
}
setCharset($charset):
public function setCharset($charset) {
$this->charset = $charset;
}

getCharset():

public function getCharset() {
return $this->charset;
}
setLanguage($language):
public function setLanguage($language) {
$this->language = $language;
}
getLanguage():
public function getLanguage() {
return $this->language;
}
setDirection($direction):
public function setDirection($direction) {
$this->direction = $direction;
}
getDirection():
public function getDirection() {
return $this->direction;
}
addLink($href, $rel):
public function addLink($href, $rel) {
$this->links[] = array(
'href' => $href,
'rel' => $rel
);
}

getLinks():
public function getLinks() {
return $this->links;
}
addStyle($href, $rel = 'stylesheet', $media = 'screen'):
public function addStyle($href, $rel = 'stylesheet', $media = 'screen') {
$this->styles[] = array(
'href' => $href,
'rel' => $rel,
'media' => $media
);
}

getStyles():
public function getStyles() {
return $this->styles;
}

addScript($script):
public function addScript($script) {
$this->scripts[] = $script;
}
getScripts():
public function getScripts() {
return $this->scripts;
}

addBreadcrumb($text, $href, $separator = ' > '):
public function addBreadcrumb($text, $href, $separator = ' > ') {
$this->breadcrumbs[] = array(
'text' => $text,
'href' => $href,
'separator' => $separator
);
}

getBreadcrumbs():
public function getBreadcrumbs() {
return $this->breadcrumbs;
}

No comments:

Post a Comment