Interface Dwoo_ITemplate

Description

interface that represents a dwoo template

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Located in /Dwoo/ITemplate.php (line 17)


	
			
Method Summary
static Dwoo_ITemplate|null|false templateFactory (Dwoo $dwoo, mixed $resourceId, [int $cacheTime = null], [string $cacheId = null], [string $compileId = null], [Dwoo_ITemplate $parentTemplate = null])
mixed cache (Dwoo $dwoo, string $output)
bool clearCache (Dwoo $dwoo, [int $olderThan = -1])
string|bool getCachedTemplate (Dwoo $dwoo)
int|null getCacheTime ()
string getCompiledTemplate (Dwoo $dwoo, [Dwoo_ICompiler $compiler = null])
string getIsModifiedCode ()
string getName ()
string|false getResourceIdentifier ()
string getResourceName ()
string getSource ()
string getUid ()
void setCacheTime ([int $seconds = null])
Methods
static templateFactory (line 149)

returns a new template object from the given resource identifier, null if no include is possible (resource not found), or false if include is not permitted by this resource type

this method should also check if $dwoo->getSecurityPolicy() is null or not and do the necessary permission checks if required, if the security policy prevents the template generation it should throw a new Dwoo_Security_Exception with a relevant message

  • access: public
static Dwoo_ITemplate|null|false templateFactory (Dwoo $dwoo, mixed $resourceId, [int $cacheTime = null], [string $cacheId = null], [string $compileId = null], [Dwoo_ITemplate $parentTemplate = null])
  • mixed $resourceId: the resource identifier
  • int $cacheTime: duration of the cache validity for this template, if null it defaults to the Dwoo instance that will render this template
  • string $cacheId: the unique cache identifier of this page or anything else that makes this template's content unique, if null it defaults to the current url
  • string $compileId: the unique compiled identifier, which is used to distinguish this template from others, if null it defaults to the filename+bits of the path
  • Dwoo_ITemplate $parentTemplate: the template that is requesting a new template object (through an include, extends or any other plugin)
  • Dwoo $dwoo
cache (line 56)

caches the provided output into the cache file

  • return: full path of the cached file or false upon failure
  • access: public
mixed cache (Dwoo $dwoo, string $output)
  • Dwoo $dwoo: the dwoo instance that requests it
  • string $output: the template output
clearCache (line 65)

clears the cached template if it's older than the given time

  • return: true if the cache was not present or if it was deleted, false if it remains there
  • access: public
bool clearCache (Dwoo $dwoo, [int $olderThan = -1])
  • Dwoo $dwoo: the dwoo instance that was used to cache that template
  • int $olderThan: minimum time (in seconds) required for the cache to be cleared
getCachedTemplate (line 47)

returns the cached template output file name, true if it's cache-able but not cached or false if it's not cached

  • access: public
string|bool getCachedTemplate (Dwoo $dwoo)
  • Dwoo $dwoo: the dwoo instance that requests it
getCacheTime (line 26)

returns the cache duration for this template

defaults to null if it was not provided

  • access: public
int|null getCacheTime ()
getCompiledTemplate (line 74)

returns the compiled template file name

  • access: public
string getCompiledTemplate (Dwoo $dwoo, [Dwoo_ICompiler $compiler = null])
  • Dwoo $dwoo: the dwoo instance that requests it
  • Dwoo_ICompiler $compiler: the compiler that must be used
getCompiler (line 117)

returns the compiler used by this template, if it was just compiled, or null

  • access: public
Dwoo_ICompiler getCompiler ()
getIsModifiedCode (line 126)

returns some php code that will check if this template has been modified or not

if the function returns null, the template will be instanciated and then the Uid checked

  • access: public
string getIsModifiedCode ()
getName (line 81)

returns the template name

  • access: public
string getName ()
getResourceIdentifier (line 95)

returns the resource identifier for this template or false if it has no identifier

  • access: public
string|false getResourceIdentifier ()
getResourceName (line 88)

returns the resource name for this template class

  • access: public
string getResourceName ()
getSource (line 102)

returns the template source of this template

  • access: public
string getSource ()
getUid (line 110)

returns an unique string identifying the current version of this template, for example a timestamp of the last modified date or a hash of the template source

  • access: public
string getUid ()
setCacheTime (line 38)

sets the cache duration for this template

can be used to set it after the object is created if you did not provide it in the constructor

  • access: public
void setCacheTime ([int $seconds = null])
  • int $seconds: duration of the cache validity for this template, if null it defaults to the Dwoo instance's cache time. 0 = disable and -1 = infinite cache

Documentation generated on Sat, 18 Jul 2009 21:05:11 +0200 by phpDocumentor 1.4.0