Send mails based on WebLab_Template.
Joins images into the e-mail for optimal viewing.
Methods
Generates a new Mail object.
__construct(String $template, String $to, String $subject, String $from, String $content_type)
Parameters
$template
StringThe template path
$subject
StringThe subject of this e-mail. Defaults to 'Automated mail'
$from
StringFrom who the receiver gets this message. Defaults to 'admin@server'
$content_type
StringThe content type to set in the headers.
Catches all the property calls to return the appropriate variable.
__get(String $name) : Object
Inherited
| inherited_from |
\WebLab_Template::__get() |
Parameters
$name
StringThe name of the property (variable) te get.
Returns
ObjectThe value of this property.
Catches all the property calls to set the appropriate variable.
__set(String $name, Object $value) : \WebLab_Template
Inherited
| inherited_from |
\WebLab_Template::__set() |
Parameters
$name
StringThe name of the property (variable) being set.
$value
Object&$value The value to be set.
Returns
Returns the value of the function render.
__toString() : String
Inherited
| inherited_from |
\WebLab_Template::__toString() |
Returns
StringReturns HTML that has been rendered by the render function. If a Exception occurs the message of this exception will be returned.
Attaches a template as a variable to this template.
attach(\WebLab_Template $template, String $moduleName) : \WebLab_Template
Inherited
| inherited_from |
\WebLab_Template::attach() |
Parameters
$moduleName
StringVariable name for $template.
Returns
Get a template variable.
get(string $variable) : \mixed:
Inherited
| inherited_from |
\WebLab_Template::get() |
Parameters
$variable
string
Returns
\mixed:
Get the root template for current request.
getRootTemplate()
InheritedStatic
| inherited_from |
\WebLab_Template::getRootTemplate() |
Get the entire stack of variables currently attached to this template.
getVars() : Array
Inherited
| inherited_from |
\WebLab_Template::getVars() |
Returns
ArrayReturn an array of attached variables. VariableNames as keys.
Generates the body of the Mail.
render(bool $show) : String
Parameters
$show
boolOutput result of this function to the browser. Defaults to false.
Returns
StringThe body of the e-mail.
Transmits the e-mail to all the receivers.
send() : bool
Returns
boolIndicates whether the send operation was successful.
Set a template variable value.
set(string $variable, mixed $value) : \WebLab_Template
Inherited
| inherited_from |
\WebLab_Template::set() |
Parameters
$variable
string
$value
mixed
Returns
Set the root template for current request.
setRootTemplate(\WebLab_Template $template)
InheritedStatic
| inherited_from |
\WebLab_Template::setRootTemplate() |
Parameters
Set the location of the template directory.
setTemplateDir(String $dir)
Inherited
This directory contains all of the themes.
| inherited_from |
\WebLab_Template::setTemplateDir() |
Parameters
$dir
StringThe directory to look for templates and themes.
Set the theme folder within the template directory.
setTheme(String $dir) : \WebLab_Template
Inherited
| inherited_from |
\WebLab_Template::setTheme() |
Parameters
$dir
StringFoldername of the theme.
Returns
Retrieve cached template
_getCache($path) : string | NULL
Inherited
| inherited_from |
\WebLab_Template::_getCache() |
Parameters
$path
Returns
stringNULL
Lazy load config.
_getConfig()
InheritedStatic
| inherited_from |
\WebLab_Template::_getConfig() |
Loads the init component of a template.
_init()
Inherited
Injecting headers, scripts or styles should be done here.
| inherited_from |
\WebLab_Template::_init() |
Include a component file for current template
$component will be attached behind the filename, including a suffix .php
_load(string $component, $extract)
Inherited
| inherited_from |
\WebLab_Template::_load() |
Parameters
$component
string
$extract
Parses the code generate by the template for images.
_parseTemplate(String $html_code) : String
Parameters
$html_code
StringThe HTML code to parse.
Returns
StringThe HTML code parsed to include images.
Put cached code
_putCache($path, string $code)
Inherited
| inherited_from |
\WebLab_Template::_putCache() |
Parameters
$path
$code
string
Set some default settings for a template.
setBasicVariables()
Inherited
| inherited_from |
\WebLab_Template::setBasicVariables() |
Properties
The maximum age in seconds of a cached template.
$max_cache_age : int
Inherited
| inherited_from |
\WebLab_Template::$$max_cache_age |
Contains config for templates.
$_config : \stdClass
Inherited
| inherited_from |
\WebLab_Template::$$_config |
The directory in which to search for the templates.
$_dir : String
Inherited
| inherited_from |
\WebLab_Template::$$_dir |
Determines if logic should be called.
$_setup : string
Inherited
| inherited_from |
\WebLab_Template::$$_setup |
Contains the path to the template file.
$_template : String
Inherited
| inherited_from |
\WebLab_Template::$$_template |
The directory of a specific theme. Defaults to 'source'.
$_theme : String
Inherited
| inherited_from |
\WebLab_Template::$$_theme |
All variables assigned to this template.
$_variables : Array
Inherited
| inherited_from |
\WebLab_Template::$$_variables |