PHP Class HeadModule, vanilla

Inheritance: extends Module
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Protected Properties

Свойство Type Description
$_Subtitle A string to be concatenated with $this->_Title.
$_Title The main text for the "title" tag in the head.
$_TitleDivider string to be concatenated with $this->_Title if there is also a $this->_Subtitle string being concatenated.

Méthodes publiques

Méthode Description
__construct ( string $Sender = '' )
addCss ( string $HRef, string $Media = '', boolean $AddVersion = true, array $Options = null ) Adds a "link" tag to the head containing a reference to a stylesheet.
addRss ( $HRef, $Title )
addScript ( string $Src, string $Type = 'text/javascript', boolean $AddVersion = true, mixed $Options = [] ) Adds a "script" tag to the head.
addString ( $String ) Adds a string to the collection of strings to be inserted into the head.
addTag ( $Tag, $Properties, $Content = null, $Index = null ) Adds a new tag to the head.
assetTarget ( ) : string
clearCSS ( ) Removes any added stylesheets from the head.
clearScripts ( ) Removes any script include tags from the head.
clearTag ( $Tag, $Property = '', $Value = '' ) Removes any tags with the specified $Tag, $Property, and $Value.
getStrings ( ) Return all strings.
getTags ( $RequestedType = '' ) Return all Tags of the specified type (or all tags).
setFavIcon ( $HRef ) Sets the favicon location.
setSubtitle ( string $subtitle = '' ) Sets the subtitle.
setTitleDivider ( string $titleDivider = ' — ' ) Sets the title divider.
tagCmp ( $A, $B ) : integer
tags ( array $Value = null ) Gets or sets the tags collection.
title ( string $Title = '', boolean $NoSubtitle = false ) : mixed | string Gets/sets the modules title.
toString ( ) Render the entire head module.

Method Details

__construct() public méthode

public __construct ( string $Sender = '' )
$Sender string

addCss() public méthode

Adds a "link" tag to the head containing a reference to a stylesheet.
public addCss ( string $HRef, string $Media = '', boolean $AddVersion = true, array $Options = null )
$HRef string Location of the stylesheet relative to the web root (if an absolute path with http:// is provided, it will use the HRef as provided). ie. /themes/default/css/layout.css or http://url.com/layout.css
$Media string Type media for the stylesheet. ie. "screen", "print", etc.
$AddVersion boolean Whether to append version number as query string.
$Options array Additional properties to pass to AddTag, e.g. 'ie' => 'lt IE 7';

addRss() public méthode

public addRss ( $HRef, $Title )
$HRef
$Title

addScript() public méthode

Adds a "script" tag to the head.
public addScript ( string $Src, string $Type = 'text/javascript', boolean $AddVersion = true, mixed $Options = [] )
$Src string The location of the script relative to the web root. ie. "/js/jquery.js"
$Type string The type of script being added. ie. "text/javascript"
$AddVersion boolean Whether to append version number as query string.
$Options mixed Additional options to add to the tag. The following values are accepted: - numeric: This will be the script's sort. - string: This will hint the script (inline will inline the file in the page. - array: An array of options (ex. sort, hint, version).

addString() public méthode

Adds a string to the collection of strings to be inserted into the head.
public addString ( $String )

addTag() public méthode

Adds a new tag to the head.
public addTag ( $Tag, $Properties, $Content = null, $Index = null )

assetTarget() public méthode

public assetTarget ( ) : string
Résultat string

clearCSS() public méthode

Removes any added stylesheets from the head.
public clearCSS ( )

clearScripts() public méthode

Removes any script include tags from the head.
public clearScripts ( )

clearTag() public méthode

Only $Tag is required.
public clearTag ( $Tag, $Property = '', $Value = '' )

getStrings() public méthode

Return all strings.
public getStrings ( )

getTags() public méthode

Return all Tags of the specified type (or all tags).
public getTags ( $RequestedType = '' )

setFavIcon() public méthode

Sets the favicon location.
public setFavIcon ( $HRef )

setSubtitle() public méthode

Sets the subtitle.
public setSubtitle ( string $subtitle = '' )
$subtitle string The subtitle which should be displayed in the title.

setTitleDivider() public méthode

This is the string that is used to concatenate title and subtitle. Defaults to ' — '.
public setTitleDivider ( string $titleDivider = ' — ' )
$titleDivider string The string that concats title and subtitle.

tagCmp() public static méthode

public static tagCmp ( $A, $B ) : integer
$A
$B
Résultat integer

tags() public méthode

Gets or sets the tags collection.
public tags ( array $Value = null )
$Value array .

title() public méthode

Gets/sets the modules title.
public title ( string $Title = '', boolean $NoSubtitle = false ) : mixed | string
$Title string
$NoSubtitle boolean
Résultat mixed | string

toString() public méthode

Render the entire head module.
public toString ( )

Property Details

$_Subtitle protected_oe property

A string to be concatenated with $this->_Title.
protected $_Subtitle

$_Title protected_oe property

The main text for the "title" tag in the head.
protected $_Title

$_TitleDivider protected_oe property

string to be concatenated with $this->_Title if there is also a $this->_Subtitle string being concatenated.
protected $_TitleDivider