API Documentation for: 1.1.1
Show:

PageBuilder Class

Extends CanteenBase
Namespace: Canteen\Parser

Responsible for building the pages and handling page requests. Located in the namespace PageBuilder.

Methods

addLoggerProfiler

(
  • contents
)
String private

Add the logger and profiler to the output

Parameters:

  • contents String

    The HTML page contents

Returns:

String:

The updated page contents

addPageContent

(
  • page
)
Page private

Generate the page content

Parameters:

  • page Page

    The page object

Returns:

Page:

The updated page object

buildTime

(
  • isAsync
)
String private

Get the current build time

Parameters:

  • isAsync Boolean

    If the request is made asyncronously

Returns:

String:

The build time HTML comment

flush

() private

Clear both the render and data page caches

getPage

(
  • id
)
Page private

Search a page by a uri

Parameters:

  • id Int

    The page ID to search for

Returns:

Page:

The site page matching the ID

getPageByUri

(
  • uri
)
Page private

Search a page by a uri

Parameters:

Returns:

Page:

The page matching the URI

getSettings

() String private

Generate a list of settings to use

Returns:

String:

HTML Script tag containing all the Canteen and custom settings

handle

() String

Handle the current page request

Returns:

String:

Output stream

handlePage

(
  • uri
  • isAsync
)
String private

Render current page

Parameters:

  • uri String

    The current uri for the page request

  • isAsync Boolean

    If the request is to be made asyncronously

Returns:

String:

Page rendering

parse

(
  • content
  • substitutions
)
String protected

Inherited from CanteenBase

Convenience method for parsing content

Parameters:

  • content String

    The string to parse

  • substitutions Dictionary

    The dictionary of tags to replace

Returns:

String:

The parsed string

service

(
  • alias
)
Service protected

Inherited from CanteenBase:

Get a service by alias

Parameters:

Returns:

Service:

The service matching the alias

setPageTitle

(
  • page
)
private

Construct the 'pageTitle' and 'fullTitle' render settings

Parameters:

  • page Page

    The page

template

(
  • name
  • [substitutions=[]
)
String protected

Inherited from CanteenBase:

Convenience method for parsing content

Parameters:

  • name String

    The name of the template to parse

  • [substitutions=[] Dictionary optional

    The dictionary of tags to replace

Returns:

String:

The parsed string

Properties

_indexPage

Page private

The page for the index of the site

_isGateway

Boolean private

See if the current view is the gate way

_pages

Array private

The collection of all pages

cache

ServerCache

Inherited from CanteenBase:

Get the instance of the site cache

DATA_CONTEXT

String final static

The cache context for the page JSON data

parser

Parser

Inherited from CanteenBase:

The parser is responsible for rendering templates

profiler

Profiler

Inherited from CanteenBase:

The instance of the profiler for debugging performance

RENDER_CONTEXT

String final static

The cache context for page renders

settings

SettingsManager

Inherited from CanteenBase:

Get the instance of the settings manager

site

Site

Inherited from CanteenBase:

Convenience getter for the site

user

Authorization

Inherited from CanteenBase:

Get the Authorization class to handle things like login, password change