PHP Class PHPFusion\OutputHandler

Show file Open project: php-fusion/PHP-Fusion Class Usage Examples

Public Properties

Property Type Description
$jqueryTags string Additional javascripts
$pageFooterTags string Additional contents to the footer
$pageHeadTags string Additional tags to the html head
$pageTitle string The title in the "title" tag

Public Methods

Method Description
addHandler ( callback $callback ) Add a new output handler function
addToFooter ( string $tag = "" ) Add content to the footer
addToHead ( string $tag = "" ) Add content to the html head
addToJQuery ( string $tag = "" ) Add javascript source code to the output
addToMeta ( string $name, string $addition = "" ) Append something to a meta tag
addToTitle ( type $addition = "" ) Append something to the title of the page
getTitle ( ) Get Current Page Title
handleOutput ( string $output ) : string Execute the output handlers
replaceInOutput ( string $target, string $replace, string $modifiers = "" ) Replace something in the output using regexp
setMeta ( string $name, string $content = "" ) Set a meta tag by name
setTitle ( string $title = "" ) Set the new title of the page

Method Details

addHandler() public static method

Add a new output handler function
public static addHandler ( callback $callback )
$callback callback The name of a function or other callable object

addToFooter() public static method

Add content to the footer
public static addToFooter ( string $tag = "" )
$tag string

addToHead() public static method

Add content to the html head
public static addToHead ( string $tag = "" )
$tag string

addToJQuery() public static method

Add javascript source code to the output
public static addToJQuery ( string $tag = "" )
$tag string

addToMeta() public static method

Append something to a meta tag
public static addToMeta ( string $name, string $addition = "" )
$name string
$addition string

addToTitle() public static method

Append something to the title of the page
public static addToTitle ( type $addition = "" )
$addition type

getTitle() public static method

Get Current Page Title
public static getTitle ( )

handleOutput() public static method

Execute the output handlers
public static handleOutput ( string $output ) : string
$output string
return string

replaceInOutput() public static method

Replace something in the output using regexp
public static replaceInOutput ( string $target, string $replace, string $modifiers = "" )
$target string Regexp pattern without delimiters
$replace string The new content
$modifiers string Regexp modifiers

setMeta() public static method

Set a meta tag by name
public static setMeta ( string $name, string $content = "" )
$name string
$content string

setTitle() public static method

Set the new title of the page
public static setTitle ( string $title = "" )
$title string

Property Details

$jqueryTags public static property

Additional javascripts
public static string $jqueryTags
return string

$pageFooterTags public static property

Additional contents to the footer
public static string $pageFooterTags
return string

$pageHeadTags public static property

Additional tags to the html head
public static string $pageHeadTags
return string

$pageTitle public static property

The title in the "title" tag
public static string $pageTitle
return string