Abstract Class myMVC_BaseView

Description

Base class for the Views.

All user's view must derive this class

  • abstract:

Located in /myMVC/BaseView.php (line 27)

myMVC_BasePage
   |
   --myMVC_BaseView
Direct descendents
Class Description
Abstract class myMVC_BaseLoginView View-class to manage a login system.
Variable Summary
 mixed $engine
 mixed $objects
 mixed $session
 mixed $variables
Method Summary
 static string createURL ( $params, $engine &$engine, array $param)
 static string createURLPrevious ( $params, $engine &$engine, array $param)
 static string errorMessage ( $params, $engine &$engine, array $param)
 static string errorMessagesAsString ( $params, $engine &$engine, array $param)
 static string formatNumber ($number $number, $decimals $decimals)
 static string getActionCSS ( $params, $engine &$engine, array $param)
 static string getActionMenuItem ( $params, $engine &$smarty, array $param)
 static string getViewToken ()
 static bool isCalledFromMenu ( $params, $engine &$engine, array $param)
 static bool isFieldValid ( $params, $engine &$engine, array $param)
 myMVC_BaseView __construct (class $engine, myMVC_HttpSession $session)
 string fetch ()
 void getTemplateFile ()
 boolean preRender ()
 void render ()
 void setObject (string $key,  $obj, mixed $value)
 void setTemplate (string $file)
 void setVariable (string $key, string $value)
Variables
mixed $engine (line 29)
  • access: protected
mixed $objects (line 33)
  • access: protected
mixed $session (line 30)
  • access: protected
mixed $templateFile (line 31)
  • access: protected
mixed $variables (line 32)
  • access: protected
Methods
static createURL (line 261)

Template-function to create an URL

  • return: The created URL
  • access: public
string createURL ( $params, $engine &$engine, array $param)
  • array $param: Associative array with the parameter. Needed is "class" with the class name If "var" is specified, the URL will be saved in this variable (using the engine) If "menuitem" is specified and his value is true, the URL will be created as menuitem (see myMVC_BaseAction::isCalledFromMenu())
  • $engine &$engine: The engine (typically myMVC_SmartyEngine)
  • $params
static createURLPrevious (line 222)

Template-function to create the URL of the previous used action

  • return: The created URL
  • access: public
string createURLPrevious ( $params, $engine &$engine, array $param)
  • array $param: Associative array with the parameter. If "var" is specified, the URL will be saved in this variable (using the engine) If "menuitem" is specified and his value is true, the URL will be created as menuitem (see myMVC_BaseAction::isCalledFromMenu())
  • $engine &$engine: The engine (typically myMVC_SmartyEngine)
  • $params
static errorMessage (line 369)

Template-function to return the error message of the given form field

  • return: The error message for the given field
  • access: public
string errorMessage ( $params, $engine &$engine, array $param)
  • array $param: Associative array with the parameter. Needed is "field" with the field name If "var" is specified, the URL will be saved in this variable (using the engine)
  • $engine &$engine: The engine (typically myMVC_SmartyEngine)
  • $params
static errorMessagesAsString (line 394)

Template-function to return all error messages as string

  • return: All error messages
  • access: public
string errorMessagesAsString ( $params, $engine &$engine, array $param)
  • array $param: Associative array with the parameter. Needed is "format" with a printf-style to describe every line. If "var" is specified, the URL will be saved in this variable (using the engine)
  • $engine &$engine: The engine (typically myMVC_SmartyEngine)
  • $params
static formatNumber (line 475)

Format a number with the actual locale information

Example: Locale de_DE: 1.234,56 Locale en_US: 1,234.56 Locale it_IT: 1234,56

  • return: The formatted number
  • access: public
string formatNumber ($number $number, $decimals $decimals)
  • $number $number: The number to be formatted
  • $decimals $decimals: How many decimals
static getActionCSS (line 309)

Template-function to return the CSS of the given action

  • return: The CSS class of the given action
  • access: public
string getActionCSS ( $params, $engine &$engine, array $param)
  • array $param: Associative array with the parameter. Needed is "class" with the class name
  • $engine &$engine: The engine (typically myMVC_SmartyEngine)
  • $params
static getActionMenuItem (line 341)

Template-function to create menu item

  • return: The action name
  • access: public
string getActionMenuItem ( $params, $engine &$smarty, array $param)
  • array $param: Associative array with the parameter. Needed is "class" with the class name
  • $engine &$smarty: The engine (typically myMVC_SmartyEngine)
  • $params
static getViewToken (line 114)

Returns the token used to identify the current View

  • return: The token
  • abstract:
  • access: public
string getViewToken ()

Redefined in descendants as:
static isCalledFromMenu (line 451)

Template-function to return whether the action, who called this view, was called from a menu or directly from another action/view

  • return: true if the field passed the validation, false otherwise
  • access: public
bool isCalledFromMenu ( $params, $engine &$engine, array $param)
  • array $param: Associative array with the parameter. If "var" is specified, the URL will be saved in this variable (using the engine)
  • $engine &$engine: The engine (typically myMVC_SmartyEngine)
  • $params
static isFieldValid (line 423)

Template-function to return whether the form field passed the validation

  • return: true if the field passed the validation, false otherwise
  • access: public
bool isFieldValid ( $params, $engine &$engine, array $param)
  • array $param: Associative array with the parameter. Needed is "field" with the field name If "var" is specified, the URL will be saved in this variable (using the engine)
  • $engine &$engine: The engine (typically myMVC_SmartyEngine)
  • $params
Constructor __construct (line 41)

Constructor.

  • access: public
myMVC_BaseView __construct (class $engine, myMVC_HttpSession $session)
  • class $engine: The engine as subclass of myMVC_BaseEngine
  • myMVC_HttpSession $session: The current session

Redefinition of:
myMVC_BasePage::__construct()
Constructor.
fetch (line 206)

Render the page and return it as string

  • return: The page as string
  • access: public
string fetch ()
getTemplateFile (line 77)

Returns the template file for the current view

  • throws: myMVC_MVCException On problems
  • access: public
void getTemplateFile ()
preRender (line 186)

Prepare to render the View

  • return: true if the page can be display, false otherwise
  • access: public
boolean preRender ()
render (line 195)

Render the page and send it to

the browser

  • access: public
void render ()
setAllInvalidFields (line 162)

Set all the invalid form fields of the previous form as variable to be displayed by the engine

  • access: protected
void setAllInvalidFields ()
setAllSubmitFields (line 151)

Set all form fields of the previous form as variable to be displayed by the engine

  • access: protected
void setAllSubmitFields ()
setAllValidFields (line 173)

Set all the valid form fields of the previous form as variable to be displayed by the engine

  • access: protected
void setAllValidFields ()
setObject (line 67)

Save an object (reference) to be used in the template

  • access: public
void setObject (string $key,  $obj, mixed $value)
  • string $key: The name of the template object
  • mixed $value: The object
  • $obj
setTemplate (line 92)

Use $file as template

  • access: protected
void setTemplate (string $file)
  • string $file: The template file
setVariable (line 56)

Save a variable to be used in the template

  • access: public
void setVariable (string $key, string $value)
  • string $key: The name of the template variable
  • string $value: The value

Inherited Methods

Inherited From myMVC_BasePage

 myMVC_BasePage::__construct()
 myMVC_BasePage::getFromPreviousSubmit()
 myMVC_BasePage::getInvalidFromPreviousSubmit()
 myMVC_BasePage::getLoggedUser()
 myMVC_BasePage::getParameterErrors()
 myMVC_BasePage::getParameterFromPreviousPage()
 myMVC_BasePage::isParameterFromPreviousSubmitValid()
 myMVC_BasePage::saveParameterForNextPage()

Documentation generated on Sat, 20 Oct 2012 08:28:27 +0200 by phpDocumentor 1.4.4