PHPDevShell 3.1.3-Stable
PHP OOP RAD Development Framework
PHPDS_controller Class Reference
Inheritance diagram for PHPDS_controller:
PHPDS_dependant

Public Member Functions

 construct ()
 POST ($key=null, $default=null, $options=0)
 GET ($key=null, $default=null, $options=0)
 run ()
 runAJAX ()
 handleResult ($raw_data)
 execute ()
 viaAJAX ()

Protected Attributes

 $_POST
 $_GET

Member Function Documentation

construct ( )

Empty function called by the actual constructor; meant to be overriden

Supposed to return false (exactly) in case of error, otherwise return the object itself

Returns:
boolean or object

Reimplemented from PHPDS_dependant.

execute ( )

This method is meant to be the entry point of your class. Most checks and cleanup should have been done by the time it's executed

Returns:
whatever, if you return "false" output will be truncated
GET ( key = null,
default = null,
options = 0 
)

Return a value from the _GET meta array

Date:
20101016 (v1.0) (greg) added
Version:
1.0
Author:
greg
Parameters:
string | null$keythe name of the get variable to fetch; if null, the entire array is returned
mixed | array$defaulta default value to return when the get variable is not set; when returning the entire array, an array can be given here with default values
integer$options
Returns:
scalar|array the content of the get variable or the whole array, possibly with default value(s)
handleResult ( raw_data)

Deal with the controller's output

Version:
1.0
Since:
3.0.5
Author:
greg <greg@phpdevshell.org>
Parameters:
mixed$raw_data
Returns:
mixed
POST ( key = null,
default = null,
options = 0 
)

Return a value from the _POST meta array

Date:
20101016 (v1.0) (greg) added
Version:
1.0
Author:
greg
Parameters:
string | null$keythe name of the post variable to fetch; if null, the entire array is returned
mixed | array$defaulta default value to return when the post variable is not set; when returning the entire array, an array can be given here with default values
integer$options
Returns:
scalar|array the content of the post variable or the whole array, possibly with default value(s)
run ( )

Does security check and runs controller.

Version:
1.1
Author:
greg <greg@phpdevshell.org>
Date:
20110307 (v1.1) (greg) calls via Ajax don't exit anymore but empty the template output instead
Returns:
mixed

This allows to load a widget/ajax theme controller via ajax without triggering the runAjax. Now runAjax can still be used within the widget/ajax menu type controller.

runAJAX ( )

Run a controller when called with ajax

Version:
1.0
Since:
3.0.5
Author:
greg <greg@phpdevshell.org>
Returns:
mixed
viaAJAX ( )

This method is run if your controller is called in an ajax context

Returns:
mixed, there are 3 cases: "true" (or nothing) the output will be handled by the template the usual way, "false" it's an error, otherwise the result data will be displayed in an empty template

Field Documentation

$_GET [protected]
$_POST [protected]

The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations