Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
SimpleViewController Class Reference

Default controller displaying php views only. More...

+ Inheritance diagram for SimpleViewController:

Public Member Functions

 __construct ()
 Constructor initialize $view variable.
 
 loadView (string $viewName, $pData=NULL, bool $asString=false)
 Loads the php view $viewName possibly passing the variables $pdata.
 
- Public Member Functions inherited from Controller
 index ()
 Default action.
 
 initialize ()
 Method called before each action Can be override in derived class.
 
 finalize ()
 Method called after each action Can be override in derived class.
 
 loadDefaultView ($pData=null, bool $asString=false)
 Loads the default view (controllerName/actionName) possibly passing the variables $pdata.
 
 getDefaultViewName ()
 Returns the default view name for this controller/action i.e ControllerName/actionName.html for the action actionName in ControllerName If there is an activeTheme @activeTheme/ControllerName/actionName.html
 
 isValid ($action)
 Returns True if access to the controller is allowed To be override in sub classes.
 
 onInvalidControl ()
 Called if isValid () returns false To be override in sub classes.
 
 forward (string $controller, string $action='index', $params=[], bool $initialize=false, bool $finalize=false)
 Loads the controller $controller and calls its $action method by passing the parameters $params.
 
 redirectToRoute (string $routeName, $parameters=[], bool $initialize=false, bool $finalize=false)
 Redirect to a route by its name.
 
 getView ()
 Returns the associated view instance.
 

Protected Member Functions

 _includeFileAsString ($filename, $pData)
 

Additional Inherited Members

- Protected Attributes inherited from Controller
View $view
 

Detailed Description

Default controller displaying php views only.

Ubiquity\controllers$ControllerView This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.1

Definition at line 14 of file SimpleViewController.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructor initialize $view variable.

Reimplemented from Controller.

Definition at line 16 of file SimpleViewController.php.

Member Function Documentation

◆ _includeFileAsString()

_includeFileAsString (   $filename,
  $pData 
)
protected

Reimplemented in SimpleViewAsyncController.

Definition at line 19 of file SimpleViewController.php.

◆ loadView()

loadView ( string  $viewName,
  $pData = NULL,
bool  $asString = false 
)

Loads the php view $viewName possibly passing the variables $pdata.

Parameters
string$viewNameThe name of the view to load
mixed$pDataVariable or associative array to pass to the view If a variable is passed, it will have the name $data in the view, If an associative array is passed, the view retrieves variables from the table's key names
boolean$asStringIf true, the view is not displayed but returned as a string (usable in a variable)
Exceptions

Exception

Returns
?string null or the view content if $asString parameter is true

Reimplemented from Controller.

Reimplemented in SimpleViewAsyncController.

Definition at line 39 of file SimpleViewController.php.


The documentation for this class was generated from the following file: