Skip to content

iCalcreator/Gectrl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gectrl

Gectrl is a PHP generic controller class package

  • Supports the MVC software design pattern
  • Distinguish controller and application logic using a strategy pattern

The controller

  • provides coordination logic

  • delegates application logic to actionClasses

  • using implementations of the (strategy) ActionClassInterface,

  • invoking of actionClass condition evaluate and opt, logic doAction methods,

  • passing all data information in an encapsulated Package class instance

    • input, output, config, logger etc

Usage

Basic

Simpler (http/html) example

<?php
namespace Kigkonsult\Gectrl;
use ActionSrc\PrepAction;
use ActionSrc\CreateAction;
use ActionSrc\ReadAction;
use ActionSrc\UpdateAction;
use ActionSrc\DeleteAction;
use ActionSrc\CatchUpAction;
require 'vendor/autoload.php';

...

$package = Gectrl::init( $config, $logger )
    ->setActionClasses(
        [
            PrepAction::class,
            CreateAction::class,
            ReadAction::class,
            UpdateAction::class,
            DeleteAction::class,
            CatchUpAction::class,
        ]
    )
    ->main( $_REQUEST );
...

echo $package->getOutput();

For more detailed usage, read Gectrl, ActionClassInterface and Package docs.

Installation

Composer, from the Command Line:

composer require kigkonsult/gectrl

In your composer.json:

{
    "require": {
        "kigkonsult/gectrl": "dev-master"
    }
}

Version 1.8 supports PHP 8, 1.6 7.4, 1.4 7.0.

Sponsorship

Donation using paypal.me/kigkonsult are appreciated. For invoice, please email.

Licence

Gectrl is licensed under the LGPLv3 License.

About

PHP generic controller

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages