OpenSencillo  2015.002
headerSeo Class Reference

Public Member Functions

 __construct ()
 keywords ($kw)
 encode ($ec='UTF-8')
 title ($t)
 description ($data)
 robots ()
 owner ($author)
 custom ($code)
 save ()
 lang ($lang)
 googleLoad ()

Data Fields

 $seo

Private Attributes

 $header
 $body
 $lang

Detailed Description

Definition at line 118 of file core_functions.php.


Constructor & Destructor Documentation

Create default status for page

Definition at line 129 of file core_functions.php.

        {
                $this->header='<!DOCTYPE html><html lang="{htmlLang}"><head>';
                $this->body='</head>';
        }

Member Function Documentation

custom ( code)

Add custom code to header

Parameters:
string$code

Definition at line 200 of file core_functions.php.

        {
                $this->header .= $code;
        }
description ( data)

Page description with max size 159 characters

Parameters:
string$data

Definition at line 170 of file core_functions.php.

        {
                if(strlen($data)>159)
                {
                        $data = substr($data,0,155).'...';
                }
                $this->header .= '<meta name="description" content="'.$data.'">';
        }
encode ( ec = 'UTF-8')

Encoding webpage

Parameters:
string$ecwebpage encoding

Definition at line 148 of file core_functions.php.

        {
                $this->header .= '<meta http-equiv="content-type" content="text/html; charset='.$ec.'" />';
        }

Add google load call

Definition at line 226 of file core_functions.php.

        {
                $this->header.='<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>';
                $this->header.='<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>';
        }
keywords ( kw)

Basic function for generate keywords tag

Parameters:
string$kwadd keywords

Definition at line 139 of file core_functions.php.

        {
                $this->header .= '<meta name="keywords" content="'.$kw.'" />';
        }
lang ( lang)

Add lang attribute to html

Definition at line 218 of file core_functions.php.

        {
                $this->header = str_replace('{htmlLang}', $lang, $this->header);
        }
owner ( author)

Add page owner and generator meta tag

Parameters:
string$author

Definition at line 191 of file core_functions.php.

        {
                $this->header .= '<meta name="author" content="'.$author.'"><meta name="generator" content="Sencillo Framework (www.opensencillo.com)">';
        }
robots ( )

Add settings for Google Bot and Bing Bot

Definition at line 182 of file core_functions.php.

        {
                $this->header .= '<meta name="ROBOTS" content="NOODP"><meta name="Slurp" content="NOYDIR">';
        }
save ( )

Save SEO and generate header content

Returns:
string

Definition at line 209 of file core_functions.php.

        {
                $this->seo = $this->header.$this->body;
                return $this->seo;
        }
title ( t)

Page title

Parameters:
string$ttitle size max 69 characters

Definition at line 157 of file core_functions.php.

        {
                if(strlen($t)>69)
                {
                        $t = substr($t,0,66).'...';
                }
                $this->header .= '<title>'.$t.'</title>';
        }

Field Documentation

$body [private]

Definition at line 123 of file core_functions.php.

$header [private]

Definition at line 122 of file core_functions.php.

$lang [private]

Definition at line 124 of file core_functions.php.

$seo

Definition at line 120 of file core_functions.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables