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.

This file is released under the LGPL "GNU Lesser General Public License" More information can be found here: http://www.gnu.org/copyleft/lesser.html

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


	
			
Method Summary
static Dwoo_ITemplate|null|false templateFactory (Dwoo $dwoo, mixed $resourceId, [int $cacheTime = null], [string $cacheId = null], [string $compileId = 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 getName ()
string|false getResourceIdentifier ()
string getResourceName ()
string getSource ()
string getUid ()
void setCacheTime ([int $seconds = null])
Methods
static templateFactory (line 139)

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

  • access: public
static Dwoo_ITemplate|null|false templateFactory (Dwoo $dwoo, mixed $resourceId, [int $cacheTime = null], [string $cacheId = null], [string $compileId = 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 $dwoo
cache (line 61)

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 70)

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 52)

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 31)

returns the cache duration for this template

defaults to null if it was not provided

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

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 122)

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

  • access: public
Dwoo_ICompiler getCompiler ()
getName (line 86)

returns the template name

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

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

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

returns the resource name for this template class

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

returns the template source of this template

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

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 43)

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 Sun, 03 Aug 2008 15:12:40 +0200 by phpDocumentor 1.4.0