\myMVC_BasePage

Generic page class. myMVC_BaseAction and myMVC_BaseView are derived from this class.

Summary

Methods
Properties
Constants
__construct()
No public properties found
No constants found
getLoggedUser()
saveParameterForNextPage()
getParameterFromPreviousPage()
getFromPreviousSubmit()
getInvalidFromPreviousSubmit()
isParameterFromPreviousSubmitValid()
getParameterErrors()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct() 

Constructor.

This function does nothing! This class will not be used, but just derived (see myMVC_BaseAction and myMVC_BaseView)

getLoggedUser()

getLoggedUser() : \myMVC_BaseLogin

Returns the current logged user, if any.

This function has to be static, then it will normally called from static functions (eg hasUserRightForAction).

Returns

\myMVC_BaseLogin

The currently logged user, or NULL if no user is logged in, or the user's class is not a subclass of myMVC_BaseLogin

saveParameterForNextPage()

saveParameterForNextPage(string  $key, string  $value) 

Save a variable in the session, to be used by the next page (Action or view).

This variable can be read with the method getParameterFromPreviousPage of the classes BaseAction or BaseView

Parameters

string $key

The name of the variable

string $value

The value

getParameterFromPreviousPage()

getParameterFromPreviousPage(string  $key) 

Returns a variable saved from the previous class with saveParameterForNextPage

Parameters

string $key

The name of the variable

getFromPreviousSubmit()

getFromPreviousSubmit(  $field) 

Returns the value for the given field in the previous submitted form.

WARNING: This function just returns the fields, that passed the validation!!

Parameters

$field

getInvalidFromPreviousSubmit()

getInvalidFromPreviousSubmit(  $field) 

Returns the value for the given field in the previous submitted form.

WARNING: This function just returns the fields, that NOT passed the validation!!

Parameters

$field

isParameterFromPreviousSubmitValid()

isParameterFromPreviousSubmitValid(string  $field) : boolean

Returns whether the given parameter of the previous submitted form passed the validation or not.

Parameters

string $field

The name of the parameter

Returns

boolean —

true if the parameter passed the validation, false otherwise

getParameterErrors()

getParameterErrors() : array

Returns all error messages after the validation of the user's parameters

Returns

array —

An associative array with all the errors in the format 'field' => 'error message'