clearFusionCMS 3.0.0
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • clearFusionCMS
    • module
      • cloudflare
      • comments
      • content
      • forms
      • members
      • search
  • fusionLib
  • None

Classes

  • _flFormGroup
  • _flUtf8Base
  • flAcMgr
  • flApiDbInstaller
  • flApiKeyMgr
  • flApiServer
  • flApiService
  • flApp
  • flAuthTOTP
  • flBufferCode
  • flBufferCss
  • flBufferJs
  • flCache
  • flCacheAPC
  • flCacheDb
  • flCacheDbInstaller
  • flCacheDummy
  • flCacheFile
  • flCacheFunction
  • flCacheMemcache
  • flCacheMemcached
  • flCacheOutput
  • flCacheRedis
  • flCacheSqlite
  • flConfig
  • flConfigDb
  • flConfigDbInstaller
  • flConfigFile
  • flConfigIni
  • flController
  • flControllerAction
  • flDate
  • flDateTzMenu
  • flDb
  • flDbInstaller
  • flDbInstallerInterface
  • flDbMySQL
  • flDbMySQLi
  • flDbMySQLiResult
  • flDbMySQLResult
  • flDbNestedSet
  • flDbResult
  • flDbSQLite
  • flDbSQLite3
  • flDbSQLite3Result
  • flDbSQLiteResult
  • flEmail
  • flEvent
  • flEventDbInstaller
  • flEventManager
  • flExceptionErrorController
  • flExceptionReporter
  • flForm
  • flFormBuilder
  • flFormDecorator
  • flFormDecoratorDl
  • flFormDecoratorDtDd
  • flFormDecoratorFieldset
  • flFormDecoratorForm
  • flFormDecoratorLi
  • flFormDecoratorList
  • flFormDecoratorUl
  • flFormElement
  • flFormElementButton
  • flFormElementCheckbox
  • flFormElementChecklist
  • flFormElementEmail
  • flFormElementFile
  • flFormElementHidden
  • flFormElementImage
  • flFormElementInteger
  • flFormElementNumber
  • flFormElementPane
  • flFormElementPassword
  • flFormElementRadio
  • flFormElementRecaptcha
  • flFormElementSearch
  • flFormElementSelect
  • flFormElementSubmit
  • flFormElementText
  • flFormElementTextArea
  • flFormElementTextSuggest
  • flFormElementUri
  • flFormElementWYSIWYG
  • flFormValidator
  • flFormValidatorAttribMax
  • flFormValidatorAttribMin
  • flFormValidatorCustomJS
  • flFormValidatorEmail
  • flFormValidatorEquals
  • flFormValidatorInteger
  • flFormValidatorMax
  • flFormValidatorMaxChecklist
  • flFormValidatorMaxLength
  • flFormValidatorMin
  • flFormValidatorMinChecklist
  • flFormValidatorMinLength
  • flFormValidatorMultiEmail
  • flFormValidatorNotEquals
  • flFormValidatorNumber
  • flFormValidatorRegex
  • flFormValidatorRequired
  • flFormValidatorSameAs
  • flFormValidatorUri
  • flFtpClient
  • flGravatar
  • flHttpClient
  • flHttpClientCookie
  • flImage
  • flImageFilter
  • flImageFilterBrightness
  • flImageFilterColorize
  • flImageFilterContrast
  • flImageFilterEdgeDetect
  • flImageFilterEmboss
  • flImageFilterGaussianBlur
  • flImageFilterGrayscale
  • flImageFilterMeanRemoval
  • flImageFilterNegative
  • flImageFilterPixelate
  • flImageFilterSelectiveBlur
  • flImageFilterSepia
  • flImageFilterSepia2
  • flImageFilterSmooth
  • flIntegrity
  • flKeygen
  • flLog
  • flLogHandlerChrome
  • flLogHandlerLoggly
  • flLogHandlerPapertrail
  • flLogHandlerSlack
  • flMimeTypes
  • flModuleDbInstaller
  • flModuleMgr
  • flRegistry
  • flRequest
  • flRequestDbInstaller
  • flRequestThrottle
  • flResponse
  • flRouter
  • flRouterRoute
  • flRssChannel
  • flRssClient
  • flRssItem
  • flSearch
  • flSearchIndexer
  • flSearchManager
  • flSearchResults
  • flSearchTags
  • flSession
  • flSessionData
  • flSessionDb
  • flSessionDbInstaller
  • flSessionFile
  • flSessionMemcache
  • flSessionMemcached
  • flSessionRedis
  • flTemplateDbInstaller
  • flTemplateEngine
  • flTemplateManager
  • flTextHTML
  • flTextSplitWords
  • flTextStemmer
  • flTextStemmerEn
  • flTextStrip
  • flTimer
  • flUri
  • flUser
  • flUserAdapter
  • flUserAdapterRemote
  • flUserDbInstaller
  • flUserMgr
  • flUserPwdGen
  • flUserServerApiV1
  • flUtf8
  • flUuid
  • flVariables
  • flVariablesDbInstaller
  • flWidgetBreadcrumb
  • flWidgetFloatingActionMenu
  • flWidgetPagination
  • flWidgetTable
  • flWidgetTabs
  • flWidgetToolbar
  • flWidgetTreeChildNode
  • flWidgetTreeLinkNode
  • flWidgetTreeNode
  • flWidgetTreeView
  • fusionLib

Interfaces

  • flFormElementWYSIWYGCodeInterface
  • flFormElementWYSIWYGInterface
  • flFormElementWYSIWYGTransformInterface
  • flLogHandler
  • flModuleInstallInterface

Exceptions

  • flAcException
  • flAppException
  • flCacheException
  • flConfigException
  • flDateException
  • flDbException
  • flEventException
  • flException
  • flExceptionBadRequest
  • flExceptionForbidden
  • flExceptionLoadClass
  • flExceptionNotFound
  • flExceptionPHP
  • flFormException
  • flHttpClientException
  • flImageException
  • flRegistryException
  • flRequestThrottleException
  • flRouterException
  • flSessionException
  • flTemplateEngineException
  • flUserException
  • flVariablesException
  • flWidgetException

Functions

  • __
  • __noop
  • _flErrorHandler
  • _n
  • _n_noop

Class flTemplateEngine

flTemplateEngine Class

Class to implement an extensible template engine which supports snippets (code blocks), chunks (html blocks) and placeholders (variables).

Syntax: [[snippet]] or [[!snippet]] for non-cached [[$chunk]] or [[!$chunk]] for non-cached [[+placeholder]] or [[!+placeholder]] for non-cached

All but placeholders can take parameters e.g. [[snippet &var=1 &var=2]] in the case of a chunk placeholders of the same name as the parameters are replaced with the passed variables.

Direct known subclasses

cfTemplateEngine

Package: fusionLib
Copyright: Copyright (c) 2007 - 2015 fusionLib. All rights reserved.
Located at system/libs/Template/flTemplateEngine.php

Methods summary

public static flDb
# setDB( flDb $db )

Set the database object to use.

Set the database object to use.

Parameters

$db
The database object or null to not use a database.

Returns

flDb
The previous database object or null.
public
# setPlaceholder( mixed $n, mixed $v = null )

Set the value of a placeholder.

Set the value of a placeholder.

Parameters

$n
The name of the placeholder or an associative array or an object.
$v
The value to set for the placeholder only used if $n is a string.
public
# unsetPlaceholder( string $name )

Unset an existing placeholder.

Unset an existing placeholder.

Parameters

$name
The name of the placeholder to unset.
public string
# getPlaceholder( string $name, string $default = '' )

Get the value of the placeholder.

Get the value of the placeholder.

Parameters

$name
The name of the placeholder to get the value of.
$default
The default value to return.

Returns

string
The value of the placeholder.
public
# registerChunk( string $name, string $html )

Register a chunk with the chunk cache.

Register a chunk with the chunk cache.

Parameters

$name
The name for the chunk.
$html
The HTML for the chunk.
public boolean
# chunkLoaded( string $name )

Test if a chunk is registered or cached.

Test if a chunk is registered or cached.

Parameters

$name
The name of the chunk to test for.

Returns

boolean
true if the chunk is registered or loaded into the chunk cache.
public string
# getChunk( string $name )

Get a chunk and return it unmodified.

Get a chunk and return it unmodified.

Parameters

$name
The name of the chunk to get.

Returns

string
The HTML that is the chunk or '' if no chunk.
public string
# parseChunk( string $name, array $placeholders = array() )

Get the contents of a named chunk parsing it and replacing tags.

Get the contents of a named chunk parsing it and replacing tags.

Parameters

$name
The name of the chunk to get.
$placeholders
Name value pair array of placeholders.

Returns

string
The HTML that is the chunk or '' if no chunk.
public
# registerSnippet( string $name, callable $fn )

Register a snippet with the snippet cache.

Register a snippet with the snippet cache.

Parameters

$name
The name of the snippet.
$fn

The callable function. The 1st parameter is the template engine flTemplateEngine and the 2nd is the array of parameters.

Throws

flTemplateEngineException
public string
# runSnippet( string $name, array $params = array() )

Run a snippet.

Run a snippet.

Parameters

$name
The name of the snippet to run.
$params
Array of name value pairs to pass to the snippet.

Returns

string
The results of executing the snippet.
protected
# _processTag( string $type, string $tag, array $params )

Internal function to process a tag, override to add tags.

Internal function to process a tag, override to add tags.

Parameters

$type
The type character.
$tag
The tag string.
$params
Array of parameters passed to the tag.
public string
# parseString( string $string, array $placeholders = array() )

Parse a string replacing tags as required.

Parse a string replacing tags as required.

Parameters

$string
The string to parse.
$placeholders
Name value pair array of placeholders.

Returns

string
The parsed string.
public flTemplateEngine
# setTheme( string $theme )

Set the theme to use.

Set the theme to use.

Parameters

$theme
The name of the theme to use.

Returns

flTemplateEngine
This object.
public flTemplateEngine
# setChildTheme( string $childTheme )

Set the child theme to use.

Set the child theme to use.

Parameters

$childTheme
The name of the child theme to use.

Returns

flTemplateEngine
This object.
public flTemplateEngine
# setCSSFramework( string $cssFramework )

Set the name of the CSS framework to use.

Set the name of the CSS framework to use.

Parameters

$cssFramework
The name of the CSS framework.

Returns

flTemplateEngine
This object.
public flTemplateEngine
# setDocumentCache( flCache $cache, integer $lifetime = null )

Set the cache to use for parseDocument.

Set the cache to use for parseDocument.

Parameters

$cache
The optional cache object.
$lifetime
The optional life time for the page in the cache.

Returns

flTemplateEngine
This object.
public flTemplateEngine
# setCodeBuffer( flBufferCode $codeBuffer )

Set the code buffer object to use.

Set the code buffer object to use.

Parameters

$codeBuffer
Optional code buffer for use in the page.

Returns

flTemplateEngine
This object.
public flBufferCode
# getCodeBuffer( )

Get the code buffer object used for storing CSS & JS.

Get the code buffer object used for storing CSS & JS.

Returns

flBufferCode
The code buffer object.
protected string
# _preReplace( array $matches )

Pre-parse marked placeholders.

Pre-parse marked placeholders.

Parameters

$matches
The matches.

Returns

string
The replacement string.
public string
# parseDocument( string $name, string $docid, array $placeholders = array() )

Parse a document.

Parse a document.

Parameters

$name
The name of the template chunk to use for the document.
$docid
Unique ID of the document.
$placeholders
Name value pair array of placeholders.

Returns

string
The parsed document string.
public integer
# lastDocFullCacheTime( )

The timestamp of the last full document parse.

The timestamp of the last full document parse.

Returns

integer
Timestamp of full cache or 0 if document has dynamic content.

Properties summary

protected array $placeholders

Array holding placeholder values.

Array holding placeholder values.

# array()
protected array $chunkCache

Cache of chunks and those registered through registerChunk.

Cache of chunks and those registered through registerChunk.

# array()
protected array $snippetCache

Cache of snippets and those registered through registerSnippet.

Cache of snippets and those registered through registerSnippet.

# array()
protected flCache $cache

The optional cache object.

The optional cache object.

# null
protected integer $lifetime

The lifetime for the page in the cache.

The lifetime for the page in the cache.

# null
protected flBufferCode $codeBuffer

The code buffer object.

The code buffer object.

# null
protected string $theme

The theme to use within the themes folder.

The theme to use within the themes folder.

# ''
protected string $childTheme

The child theme to use.

The child theme to use.

# ''
protected string $cssFramework

The CSS framework to use.

The CSS framework to use.

# ''
protected string $tagChars

Supported tag characters.

Supported tag characters.

# '+$*'
protected integer $lastDocFullCacheTime

The timestamp of the last documents full cache build.

The timestamp of the last documents full cache build.

# 0
protected static flDb $db

The database engine to read template elements from.

The database engine to read template elements from.

# null
clearFusionCMS 3.0.0 API documentation generated by ApiGen