Class Dwoo_Template_File

Description

represents a Dwoo template contained in a file

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/Template/File.php (line 22)

Dwoo_Template_String
   |
   --Dwoo_Template_File
Variable Summary
string $file
array $includePath
string $resolvedPath
Method Summary
static Dwoo_Template_File|null templateFactory (Dwoo $dwoo, mixed $resourceId, [int $cacheTime = null], [string $cacheId = null], [string $compileId = null])
Dwoo_Template_File __construct (string $file, [int $cacheTime = null], [string $cacheId = null], [string $compileId = null], [mixed $includePath = null])
string getCompiledFilename (Dwoo $dwoo)
string getCompiledTemplate (Dwoo $dwoo, [Dwoo_ICompiler $compiler = null])
array getIncludePath ()
string getResourceName ()
string getSource ()
string getUid ()
void setIncludePath (mixed $paths)
Variables
string $file (line 29)

template filename

  • access: protected
array $includePath = null (line 36)

include path(s) to look into to find this template

  • access: protected
string $resolvedPath = null (line 45)

resolved path cache when looking for a file in multiple include paths

this is reset when the include path is changed

  • access: protected

Inherited Variables

Inherited from Dwoo_Template_String

Dwoo_Template_String::$cache
Dwoo_Template_String::$cacheId
Dwoo_Template_String::$cacheTime
Dwoo_Template_String::$compilationEnforced
Dwoo_Template_String::$compileId
Dwoo_Template_String::$compiler
Dwoo_Template_String::$name
Methods
static templateFactory (line 224)

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_Template_File|null templateFactory (Dwoo $dwoo, mixed $resourceId, [int $cacheTime = null], [string $cacheId = null], [string $compileId = null])
  • Dwoo $dwoo: the dwoo instance requiring it
  • mixed $resourceId: the filename (relative to this template's dir) of the template to include
  • 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

Redefinition of:
Dwoo_Template_String::templateFactory()
returns false as this template type does not support inclusions
Constructor __construct (line 61)

creates a template from a file

  • access: public
Dwoo_Template_File __construct (string $file, [int $cacheTime = null], [string $cacheId = null], [string $compileId = null], [mixed $includePath = null])
  • string $file: the path to the template file, make sure it exists
  • 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
  • mixed $includePath: a string for a single path to look into for the given file, or an array of paths

Redefinition of:
Dwoo_Template_String::__construct()
creates a template from a string
getCompiledFilename (line 257)

returns the full compiled file name and assigns a default value to it if required

  • return: the full path to the compiled file
  • access: protected
string getCompiledFilename (Dwoo $dwoo)
  • Dwoo $dwoo: the dwoo instance that requests the file name

Redefinition of:
Dwoo_Template_String::getCompiledFilename()
returns the full compiled file name and assigns a default value to it if required
getCompiledTemplate (line 114)

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

Redefinition of:
Dwoo_Template_String::getCompiledTemplate()
returns the compiled template file name
getIncludePath (line 102)

return the current include path(s)

  • access: public
array getIncludePath ()
getResourceIdentifier (line 179)

returns this template's source filename

  • access: public
string getResourceIdentifier ()

Redefinition of:
Dwoo_Template_String::getResourceIdentifier()
returns the resource identifier for this template, false here as strings don't have identifiers
getResourceName (line 169)

returns the resource name for this template class

  • access: public
string getResourceName ()

Redefinition of:
Dwoo_Template_String::getResourceName()
returns the resource name for this template class
getSource (line 159)

returns the template source of this template

  • access: public
string getSource ()

Redefinition of:
Dwoo_Template_String::getSource()
returns the template source of this template
getUid (line 203)

returns an unique value identifying the current version of this template, in this case it's the unix timestamp of the last modification

  • access: public
string getUid ()

Redefinition of:
Dwoo_Template_String::getUid()
returns an unique value identifying the current version of this template, in this case it's the md4 hash of the content
setIncludePath (line 87)

sets the include path(s) to where the given template filename must be looked up

  • access: public
void setIncludePath (mixed $paths)
  • mixed $paths: the path to look into, can be string for a single path or an array of paths

Inherited Methods

Inherited From Dwoo_Template_String

Dwoo_Template_String::__construct()
Dwoo_Template_String::cache()
Dwoo_Template_String::clearCache()
Dwoo_Template_String::forceCompilation()
Dwoo_Template_String::getCachedTemplate()
Dwoo_Template_String::getCacheFilename()
Dwoo_Template_String::getCacheTime()
Dwoo_Template_String::getCompiledFilename()
Dwoo_Template_String::getCompiledTemplate()
Dwoo_Template_String::getCompiler()
Dwoo_Template_String::getName()
Dwoo_Template_String::getResourceIdentifier()
Dwoo_Template_String::getResourceName()
Dwoo_Template_String::getSource()
Dwoo_Template_String::getUid()
Dwoo_Template_String::makeDirectory()
Dwoo_Template_String::setCacheTime()
Dwoo_Template_String::templateFactory()

Documentation generated on Sun, 03 Aug 2008 15:12:35 +0200 by phpDocumentor 1.4.0