Class for building pages

All methods are chainable, with the exception of the constructor, build_header(), build_footer(), and _headers() methods.

package miniMVC
subpackage System

 Methods

Set up the page class

__construct() : void

Sets custom page header

build_header(bool $html5) : \Page

Parameters

$html5

bool

Returns

Output String

output_string(string $string) 

Similar to render(), this is a shortcut to output a string in the body of the page.

Parameters

$string

string

Redirect 303

redirect_303(string $url) 

Shortcut function for 303 redirect

Parameters

$url

string

Render

render(string $view, array $data) 

Shortcut function for building a page

Parameters

$view

string

$data

array

Sets custom base href

set_base(string $href) : \Page

Parameters

$href

string

href

Returns

Sets custom body class

set_body_class(string $class) : \Page

Parameters

$class

string

Returns

Sets custom body id

set_body_id(string $id) : \Page

Parameters

$id

string

Returns

Sets a minified css group

set_css_group(string $group) : \Page

Parameters

$group

string

Returns

Sets custom css tags

set_css_tag(string $name, bool $domain, string $media) : \Page

Parameters

$name

string

$domain

bool

$media

string

Returns

Sets a minified javascript group for the page footer

set_foot_js_group(string $group, bool $debug) : \Page

Parameters

$group

string

$debug

bool

Returns

Sets minified javascript group in header

set_head_js_group(string $group, bool $debug) : \Page

Parameters

$group

string

$debug

bool

Returns

Sets a custom tag in the header

set_head_tag(string $tag) : \Page

Parameters

$tag

string

Returns

Set Message

set_message(string $type, string $message, $return) : void

Adds a message to the page

Parameters

$type

string

$message

string

$return

Set Meta

set_meta(array $meta) : \Page

Sets meta tags, with codeigniter native meta tag helper

Parameters

$meta

array

Returns

Sets html title string

set_title(string $title) : \Page

Parameters

$title

string

Returns

Sets server headers and doctype

_headers(bool $html5) : \Page

Also sets page mime type, based on if sent as html or xhtml, and what the target browser supports

Parameters

$html5

bool

Returns

Private helper function to generate meta tags

_meta(array $params) : string

Parameters

$params

array

Returns

string

Script Tag

script_tag(string $js, bool $domain) : string

Helper function for making script tags

Parameters

$js

string

$domain

bool

Returns

string

 Properties

 

Base tag

$base : string

 

Class(es) to apply to the main body tag

$body_class : string

 

Id to apply to the body tag

$body_id : string

 

CSS tags for the page

$css : string

 

JS tags for the footer

$foot_js : string

 

JS tags for the header

$head_js : string

 

Additional header tags

$head_tags : string

 

Meta tags

$meta : string

 

Page title

$title : string