Some helper for the code inside tag

author etessore

 Methods

Initializes this object to default data

__construct() 

Adds an inline JavaScript to the current head section

add_inline_script(string $content, string $name) : \HeadHelper

Parameters

$content

string

the js code

$name

string

the name of the script

Returns

\HeadHelper$this for chainability

Delete a meta tag

delete_meta_tag(string $name) 

Parameters

$name

string

the meta name

Retrieves some usefull meta tags for the <head>

get_head() : \some

Returns

\someusefull meta tags for the

Retrieve the meta tags list ready to be inserted into <head>

render_meta_tags() 

Set the charset for the page

set_charset(string $charset) 

Parameters

$charset

string

the charset

Set a meta tag

set_meta_tag(array $meta) : \HeadHelper

Parameters

$meta

array

the meta tag

Returns

\HeadHelper$this for chainability

Set the title

set_title(string $title) 

Parameters

$title

string

the title

Sets the Google Analytics tracking code

set_ua(string $ga) 

Parameters

$ga

string

UA-XXXXXX

Print the markup

the_head() 

Render a single meta tag of the current set stored in $this->meta_tags

render_meta_tag(string $name) 

Parameters

$name

string

the name of the meta

 Properties

 

charset of the page

$charset : \the
 

list of inline JavaScripts to insert in the <head> tag

$custom_scripts : array
   

of name => content valuse for the meta tags.

$meta_tags : array
 

the title

$title : string
 

Google Analytics tracking code

$ua : string