liberty_code / controller
Library
v1.0.0
2022-01-03 21:59 UTC
Requires
- php: ~7 || ~8
- liberty_code/library: ^1.0.
This package is auto-updated.
Last update: 2025-01-29 06:07:50 UTC
README
Description
Library contains access and controller components.
Requirement
- Script language: PHP: version 7 || 8
Installation
Several ways are possible:
Composer
Requirement
It requires composer installation. For more information: https://getcomposer.org
Command: Move in project root path
cd "<project_root_path>"
Command: Installation
php composer.phar require liberty_code/controller ["<version>"]
Note
Include vendor
If project uses composer, vendor must be included:
require_once('<project_root_path>/vendor/autoload.php');
Configuration
Installation command allows to add, on composer file "
{ "require": { "liberty_code/controller": "<version>" } }
Include
Download
- Download following repository.
- Put it on repository root path.
Include source
require_once('<repository_root_path>/include/Include.php');
Configuration
Main configuration
Use following class to configure specific elements
use liberty_code\controller\config\model\DefaultConfig; DefaultConfig::instanceGetDefault()->get|set...();
Elements configurables
- Method access options
Usage
Controller
Controller allows to design basic controller, and control access of itself and its all methods, from specified access policy.
Example
class ControllerTest extends liberty_code\controller\controller\model\DefaultController
{
// Define global access policy
public function checkAccessEngine()
{
...
// Return boolean
}
// Define method access policy
public function checkAccessMethodEngine($strMethodNm, array $tabArg = null)
{
...
// Return boolean
}
}
...