yana

phpDocumentor v 1.4.0

Class SmartView

Description

«Singleton» View
A manager class to automate searching and loading of templates, belonging to view layer.
  • access: public
Object
   |
   --SmartTemplate
      |
      --SmartView
Method Summary
  • string|bool(false) getTemplate (int $i)
  • bool setTemplates ([string $frameTemplate = null], [string $embeddedTemplate = null])
  • void showMessage (string $type, string $errcode, [string $event = ""], [string $template = "message"])

Methods

get id of selected template
string|bool(false) getTemplate (
int $i
)
List of parameters:
Name Type Description
$i int
Description:
This returns the id of the template at index $i, where $i=0 is the main template and $i=1 is the embedded template.
Returns bool(false) if the requested template is not set.
Note that this function does not recurse inside a template to find imported templates as well, because this would include parsing the templates, what is beyond the scope of this function.
  • access: public
select template by template id
bool setTemplates (
[string $frameTemplate = null], [string $embeddedTemplate = null]
)
List of parameters:
Name Type Description
$frameTemplate string
$embeddedTemplate string
Description:
Will select the templates for frame and content of the view, where $frameTemplate and $frameTemplate are the ids of the selected templates.
Returns bool(true) on success or bool(false) on error.
Example of usage:
  1.  $GLOBALS['YANA']->view->setTemplates('index');
  • access: public
output a message to browser and terminate the program
void showMessage (
string $type, string $errcode, [string $event = ""], [string $template = "message"]
)
List of parameters:
Name Type Description
$type string alert, error, aso.
$errcode string 404, 500, aso.
$event string event to trigger, e.g. 'index'
$template string id of template to use
Description:
NOTE: This function will terminate program execution
  • access: public
inherited from base classes

Inherited From SmartTemplate

Inherited From Object

Documentation generated on Sat, 03 Jan 2009 22:22:33 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net