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 callActionStaticFunction ( $params, $engine &$smarty, array $param)
 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 array errorMessagesAsArray ( $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 callActionStaticFunction (line 391)

Template-function to call an arbitrary static function of a given Action class

  • return: The action name
  • access: public
string callActionStaticFunction ( $params, $engine &$smarty, array $param)
  • array $param: Associative array with the parameter. Needed are "class" with the class name and "method" as the static method
  • $engine &$smarty: The engine (typically myMVC_SmartyEngine)
  • $params
static createURL (line 274)

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

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

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 errorMessagesAsArray (line 473)

Template-function to return all error messages as numeric array of associative arrays ('field' => <field name>, 'message' => <error message>)

  • return: All error messages as numeric array of associative arrays
  • access: public
array errorMessagesAsArray ( $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 errorMessagesAsString (line 444)

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

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

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

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

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

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

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

Prepare to render the View

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

Render the page and send it to

the browser

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

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

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

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

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

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 Wed, 06 Feb 2013 20:58:24 +0100 by phpDocumentor 1.4.4