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.

Located in /Dwoo/Template/File.php (line 17)

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_ITemplate $parentTemplate = null])
Dwoo_Template_File __construct (string $file, [int $cacheTime = null], [string $cacheId = null], [string $compileId = null], [mixed $includePath = null])
string getCompiledFilename (Dwoo $dwoo)
array getIncludePath ()
string getIsModifiedCode ()
string getResourceName ()
string getSource ()
string getUid ()
boolean isValidCompiledFile (string $file)
void setIncludePath (mixed $paths)
Variables
string $file (line 24)

template filename

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

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

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

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::$chmod
Dwoo_Template_String::$compilationEnforced
Dwoo_Template_String::$compileId
Dwoo_Template_String::$compiler
Dwoo_Template_String::$name
Methods
static templateFactory (line 186)

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_ITemplate $parentTemplate = 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
  • Dwoo_ITemplate $parentTemplate: the template that is requesting a new template object (through an include, extends or any other plugin)

Redefinition of:
Dwoo_Template_String::templateFactory()
returns a new template string object with the resource id being the template source code
Constructor __construct (line 56)

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

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
getIncludePath (line 97)

return the current include path(s)

  • access: public
array getIncludePath ()
getIsModifiedCode (line 266)

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

Redefinition of:
Dwoo_Template_String::getIsModifiedCode()
returns some php code that will check if this template has been modified or not
getResourceIdentifier (line 138)

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

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

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

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
isValidCompiledFile (line 109)

Checks if compiled file is valid (exists and it's the modification is greater or equal to the modification time of the template file)

  • return: True cache file existance and it's modification time
  • access: protected
boolean isValidCompiledFile (string $file)
  • string $file: file

Redefinition of:
Dwoo_Template_String::isValidCompiledFile()
Checks if compiled file is valid (it exists)
setIncludePath (line 82)

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::getChmod()
Dwoo_Template_String::getCompiledFilename()
Dwoo_Template_String::getCompiledTemplate()
Dwoo_Template_String::getCompiler()
Dwoo_Template_String::getIsModifiedCode()
Dwoo_Template_String::getName()
Dwoo_Template_String::getResourceIdentifier()
Dwoo_Template_String::getResourceName()
Dwoo_Template_String::getSource()
Dwoo_Template_String::getUid()
Dwoo_Template_String::isValidCompiledFile()
Dwoo_Template_String::makeDirectory()
Dwoo_Template_String::setCacheTime()
Dwoo_Template_String::setChmod()
Dwoo_Template_String::templateFactory()

Documentation generated on Sun, 07 Feb 2010 17:53:45 +0000 by phpDocumentor 1.4.0