Skip to content

classes_base_htmlpage.class

Daniel Spors edited this page Nov 11, 2020 · 4 revisions

Classes in file base/htmlpage.class.php

class HtmlPage

Base class for all Html pages. Will perform all rendering and collect js, css, meta and more.

Namespace: ScavixWDF\Base

Implements: ICallable

Extends: Template » Renderable

Subclasses: SysAdmin

addCss

Adds a link tag (type=css) to the page Like this: <link rel='stylesheet' type='text/css' href='$src'/>

Definition: public function addCss($src, $key)

Returns: HtmlPage $this

Parameters:

  • string $src The src attribute

  • string $key Optional data-key attribute for the link tag

addDocReady

Adds code to the document ready event.

Definition: public function addDocReady($js_code, $jq_wrapped=true)

Returns: HtmlPage $this

Parameters:

  • mixed $js_code JS code as string or array

  • bool $jq_wrapped If true adds the code to the ready event handler, else will be added inline into the head script element

addHeaderRaw

Adds raw code to the header

Definition: public function addHeaderRaw($code, $pre=false)

Returns: HtmlPage $this

Parameters:

  • string $code The raw code

  • bool $pre Should it be added before the standard css and js files in the header?

AddIE9PinningTask

Adds a task to the InternetExplorer 'Jump List' See http://msdn.microsoft.com/en-us/library/ie/gg491725%28v=vs.85%29.aspx

Definition: public function AddIE9PinningTask($name, $url, $icon_url, $window_type)

Returns: HtmlPage $this

Parameters:

  • string $name The task name that appears in the Jump List

  • string $url The address that is launched when the item is clicked

  • string $icon_url The icon resource that appears next to the task in the Jump List

  • string $window_type One of 'tab', 'self' or 'window'

addJs

Adds a script tag to the page Like this: <script type='text/javascript' src='$src'></script>

Definition: public function addJs($src, $key)

Returns: HtmlPage $this

Parameters:

  • string $src The src attribute

  • string $key Optional data-key attribute for the script tag

addLink

Adds a link tag to the page Like this: <link rel='$rel' type='$type' title='$title' href='$href'/>

Definition: public function addLink($rel, $href, $type, $title)

Returns: HtmlPage $this

Parameters:

  • string $rel The rel attribute

  • string $href The href attribute

  • string $type The type attribute

  • string $title The title attribute

addMeta

Adds a meta tag to the page Like this <meta name='$name' content='$content' scheme='$scheme'/>

Definition: public function addMeta($name, $content, $scheme, $type)

Returns: HtmlPage $this

Parameters:

  • string $name The name

  • string $content The content

  • string $scheme The scheme

  • string $type The meta-tags name ('name','http-equiv',...)

AddPolyfills

Adds polyfill to the rendered HTML page. This feature uses https://polyfill.io to magically make your website work in nearly every browser.

Definition: public static function AddPolyfills($pf)

Returns: void

Parameters:

  • array|string $pf Requested polyfills

SetIE9PinningData

Sets InternetExplorer 'Pinned Site Metadata' See http://msdn.microsoft.com/en-us/library/ie/gg491732%28v=vs.85%29.aspx

Definition: public function SetIE9PinningData($application, $tooltip, $start_url, $button_color=false)

Returns: HtmlPage $this

Parameters:

WdfRender

OVERRIDE Template::WdfRender

WdfRenderAsRoot

OVERRIDE Template::WdfRenderAsRoot

__initialize

This is WDF constructor equivalent

Definition: public function __initialize($title, $body_class=false)

Returns: NOT DOCUMENTED

Parameters:

  • string $title Page title

  • string $body_class Optional value for the class attribute of the <body> element

Clone this wiki locally