Download [comment]: # (This file is part of Gectrl, PHP Genereric controller. Copyright 2021 Kjell-Inge Gustafsson, kigkonsult, All rights reserved, licence LGPLv3)
Class Gectrl
Gectrl is a PHP generic controller class
-
Supports the MVC software design pattern
-
Distinguish controller and application logic using a strategy pattern
The controller provides coordination logic
The controller delegates application logic to actionClasses
-
using implementations of the (strategy) [ActionClassInterface],
-
invoking of actionClass condition evaluate (in order)
and opt, logicdoAction* methods,
-
passing all data information in an encapsulated [Package] class instance
* input, output, config, logger etc
For [ActionClassInterface] example, please review test/AcSrc/ActionExampleTest.php.<br>
To obtain actionsClasses (FQCNs) from namespace(s), you may use [hpierce1102/ClassFinder].<br>
Any trait / interface / abstract class in FQCNs array are ignored.
Class common methods
__construct( [ config [, logger [, actionClasses ]]] )
-
Gectrl constructor
-
-
-
-
Creates (internal) _[Package]_ class intance (in the package property)
init( [ config [, logger [, actionClasses ]]] )
-
Gectrl (static) factory
-
-
-
-
Return _Gectrl_ class instance
-
_static_
main( [ input ] )
Properties && methods
actionClasses
-
valueType : _string[]_ actionClass FQCNs
getActionClasses()
-
Return _string[]_ actionClasses (FQCNs)
isActionClassSet( [ fqcn] )
-
-
Return _bool_, true if actionsClasses (fqcn) is set, otherwise false
addActionClass( actionClass )
setActionClasses( actionClasses )
-
Set (string[]) actionClasses (FQCNs)
-
any trait / interface / abstract class in FQCNs array ignored
-
-
Return _static_
-
Throws _InvalidArgumentException_ on other class, interface or trait error
package
-
valueType : _[Package]_
-
Created at Gectrl class intance creation
getPackage()
-
Return _[Package]_ (passed as reference)
setPackage( package )
-
Set (replacing) _[Package]_
-
-
Return _static_
Go to [README], [ActionClassInterface], [Package] docs.
[ActionClassInterface]:ActionClassInterface.md
[hpierce1102/ClassFinder]:https://gitlab.com/hpierce1102/ClassFinder
[Package]:Package.md
[README]:../README.md
|