PHP Класс HeadModule, vanilla

Наследование: extends Module
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

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

addCss() публичный Метод

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 addRss ( $HRef, $Title )
$HRef
$Title

addScript() публичный Метод

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() публичный Метод

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

addTag() публичный Метод

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

assetTarget() публичный Метод

public assetTarget ( ) : string
Результат string

clearCSS() публичный Метод

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

clearScripts() публичный Метод

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

clearTag() публичный Метод

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

getStrings() публичный Метод

Return all strings.
public getStrings ( )

getTags() публичный Метод

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

setFavIcon() публичный Метод

Sets the favicon location.
public setFavIcon ( $HRef )

setSubtitle() публичный Метод

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

setTitleDivider() публичный Метод

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 tagCmp ( $A, $B ) : integer
$A
$B
Результат integer

tags() публичный Метод

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

title() публичный Метод

Gets/sets the modules title.
public title ( string $Title = '', boolean $NoSubtitle = false ) : mixed | string
$Title string
$NoSubtitle boolean
Результат mixed | string

toString() публичный Метод

Render the entire head module.
public toString ( )

Описание свойств

$_Subtitle защищенное свойство

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

$_Title защищенное свойство

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

$_TitleDivider защищенное свойство

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