\lftemplate

Template ssyttem

Littlefoot->select will go here. so will render

Dev note

I have found a problem with calling template asynchronously:

If you store it in a variable: $template = (new template), and make changes to the variable, it keeps its original values. So if you append to title somewhere else, save this will revert back to the original title that hasnt been changed in this local instance. Maybe a statis internal variable would have fixed that, but I still like session better until someone talks me out of it.

Summary

Methods
Properties
Constants
__construct()
load()
addHead()
setTitle()
appendTitle()
printContent()
getLogin()
printLogin()
getTitle()
getSkinBase()
addContent()
getContent()
addCss()
addJs()
getUriAsArray()
render()
execTemplate()
replaceHead()
renderHead()
renderJs()
renderCss()
setHome()
getTemplatePath()
getTemplateName()
setSkin()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
save()
$elements
N/A

Properties

$elements

$elements : 

Type

Methods

__construct()

__construct() 

At construct time, load elements from session

Detect if Ajax request

load()

load() 

Try to get elements from session, otherwise, push default ones to session

addHead()

addHead(  $content) 

Add $content to the end of the <head /> array

Parameters

$content

setTitle()

setTitle(  $newTitle) 

Set whole title to $newTitle

Parameters

$newTitle

appendTitle()

appendTitle(  $extraTitle) 

Add $extraTitle to end of `title` array

Parameters

$extraTitle

printContent()

printContent(  $key = 'content') 

Return either the imploded array of the given $key, or an error stating that there was nothing saved at that key.

Parameters

$key

getLogin()

getLogin() 

Capture login output, return as string

printLogin()

printLogin() 

Include login system template

getTitle()

getTitle() 

Get imploded title array around (' | ')

getSkinBase()

getSkinBase() 

Returns http:// URL of the folder root of the current skin

addContent()

addContent(  $data,   $namespace = 'content') 

Add $data to the list of output section array called $namespace ('content' by default)

This is used by the template system to later print easily into the skin.

Parameters

$data
$namespace

getContent()

getContent(  $namespace = 'content') 

Return an implode of the array saved at $namespace. We put things in there with `$this->addContent($string, 'content');`

Parameters

$namespace

addCss()

addCss(  $url) 

Add a CSS URL to the css array. We handle the HTML for it separately in `renderCss()`

Parameters

$url

addJs()

addJs(  $url) 

Add a JS URL to the js array. We handle this HTML for it separately in `renderJs()`

Parameters

$url

getUriAsArray()

getUriAsArray() 

Kyle wrote this. I like the idea of splitting the URI with `/`, but would need some reworking. I dont currently use this method.

render()

render() 

Render the stored content results and render anything in css, js, head after we exec the template

You can render from a different LF folder. Just chdir to it before render, and it will not know you moved somewhere. this works in the index.php as well

execTemplate()

execTemplate() 

Load skin data

replaceHead()

replaceHead(  $template) 

Replace the `renderHead()` result into the bottom of `</head>` with a string replace.

Parameters

$template

renderHead()

renderHead() 

Combines js, css, and anything wrong in head

renderJs()

renderJs() 

For each js URL, render into HTML `<script />` include, and implode results over "\n"

renderCss()

renderCss() 

For each css URL, render into HTML `<link />` include, and implode results over "\n"

setHome()

setHome(  $bool) 

Set the home boolean. If enabled, home.php would be preferred over index.php, but will fall back to index.php if not there.

Parameters

$bool

getTemplatePath()

getTemplatePath() 

Return string of path to currently selected skin

getTemplateName()

getTemplateName() 

Return name of currently selected skin

setSkin()

setSkin(  $skinName) 

Set skin with `$skinName` to load upon `render()`

Parameters

$skinName

save()

save() 

Save current $this->elements to session