# \page_renderer

Renders the HTML page that is sent to the client.

## Summary

Methods
Properties
Constants
register_part_preprocessor()
render()
render_main()
render_minimal()
get_header_html()
get_css_as_html()
AddJSLink()
AddJSSnippet()
render_navigation_bar()
render_username()
generate_all_pages_datalist()
$html_template
$main_content_template
$minimal_content_template
$nav_divider
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  core.php
Package
  core
Class hierarchy
  \page_renderer

## Tags

None found

## Properties

### $html_template

    $html_template : string

The root HTML template that all pages are built from.

#### Type

string

#

## Tags

package | core

### $main_content_template

    $main_content_template : string

The main content template that is used to render normal wiki pages.

#### Type

string

#

## Tags

package | core

### $minimal_content_template

    $minimal_content_template : string

A specially minified content template that doesn't include the navbar and other elements not suiltable for printing.

#### Type

string

#

## Tags

package | core

### $nav_divider

    $nav_divider : string

The navigation bar divider.

#### Type

string

#

## Tags

package | core

## Methods

### register_part_preprocessor()

    register_part_preprocessor(\function  $function)

Registers a function as a part post processor.

This function's use is more complicated to explain. Pepperminty Wiki renders pages with a very simple templating system. For example, in the template a page's content is denoted by `{content}`. A function registered here will be passed all the components of a page just before they are dropped into the template. Note that the function you pass in here should take a reference to the components, as the return value of the function passed is discarded.

#### Parameters

\function | $function | The part preprocessor to register.

#

static

## Tags

package | core

### render()

    render(string  $title, string  $content, boolean  $body_template = false) : string

Renders a HTML page with the content specified.

#### Parameters

string | $title | The title of the page.
string | $content | The (HTML) content of the page.
boolean | $body_template | The HTML content template to use.

#### Returns

string —

The rendered HTML, ready to send to the client :-)

#

static

## Tags

package | core

### render_main()

    render_main(string  $title, string  $content) : string

Renders a normal HTML page.

#### Parameters

string | $title | The title of the page.
string | $content | The content of the page.

#### Returns

string —

The rendered page.

#

static

## Tags

package | core

### render_minimal()

    render_minimal(string  $title, string  $content) : string

Renders a minimal HTML page. Useful for printable pages.

#### Parameters

string | $title | The title of the page.
string | $content | The content of the page.

#### Returns

string —

The rendered page.

#

static

## Tags

package | core

### get_header_html()

    get_header_html() : string

Renders the header HTML.

#### Returns

string —

The rendered HTML that goes in the header.

#

static

## Tags

package | core

### get_css_as_html()

    get_css_as_html() : string

Renders all the CSS as HTML.

#### Returns

string —

The css as HTML, ready to be included in the HTML header.

#

static

## Tags

package | core

### AddJSLink()

    AddJSLink(string  $scriptUrl)

Adds the specified url to a javascript file as a reference to the page.

#### Parameters

string | $scriptUrl | The url of the javascript file to reference.

#

## Tags

package | core

### AddJSSnippet()

    AddJSSnippet(string  $script)

Adds a javascript snippet to the page.

#### Parameters

string | $script | The snippet of javascript to add.

#

## Tags

package | core

### render_navigation_bar()

    render_navigation_bar(array  $nav_links, array  $nav_links_extra, string  $class = "")

Renders a navigation bar from an array of links. See $settings->nav_links for format information.

#### Parameters

array | $nav_links | The links to add to the navigation bar.
array | $nav_links_extra | The extra nav links to add to the "More..." menu.
string | $class | The class(es) to assign to the rendered navigation bar.

#

static

## Tags

package | core

### render_username()

    render_username(string  $name) : string

Renders a username for inclusion in a page.

#### Parameters

string | $name | The username to render.

#### Returns

string —

The username rendered in HTML.

#

static

## Tags

package | core

### generate_all_pages_datalist()

    generate_all_pages_datalist() : string

Renders the datalist for the search box as HTML.

#### Returns

string —

The search box datalist as HTML.

#

static

## Tags

package | core

### core.php