2017 © Pedro PelĂĄez
 

project scaffolding

GCsystem PHP Framework scaffolding plugin

image

gcsystem/scaffolding

GCsystem PHP Framework scaffolding plugin

  • Thursday, May 31, 2018
  • by fabsgc
  • Repository
  • 1 Watchers
  • 0 Stars
  • 118 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

  • Open-Source
  • Version : 3.1 BĂȘta
  • Author : Fabsgc
  • Contributors : Lucas5190, t1307
  • Description : GCsystem Framework scaffolding plugin

Installation :

  • In composer add
"autoload": {
    "psr-4": {
        "Scaffolding\\" : "vendor/gcsystem/scaffolding/src"
    }
},

Then, create a new controller and change the extends Controller by extends \Scaffolding\Scaffolding, (*1)

<?php
    namespace Gcs;

    use System\Config\Config;
    use System\Response\Response;

    /**
     * Class Scaffolding
     * @package Gcs
     * @Before(class="\Gcs\Scaffolding", method="init")
     */

    class Scaffolding extends \Scaffolding\Scaffolding {

        public function init() {
            if (Config::config()['user']['debug']['environment'] != 'development') {
                Response::instance()->status(404);
            }
        }
    }

There are five actions and all except the first take one or two GET parameters : "entity" (the entity name) and id (the primary key) :, (*2)

  • home
  • entity
  • insert
  • update
  • delete

You can override all of these methods to custom your administration., (*3)

Then for example create these routes :, (*4)

<group name="scaffolding" url="/scaffolding" action="scaffolding">
  <route name="default" url="(/*)" action="home"/>
  <route name="insert" url="/entity/insert/([a-zA-Z]+)(/*)" action="insert" vars="entity"/>
  <route name="update" url="/entity/update/([a-zA-Z]+)/([0-9]+)(/*)" action="update" vars="entity,id"/>
  <route name="delete" url="/entity/delete/([a-zA-Z]+)/([0-9]+)(/*)" action="delete" vars="entity,id"/>
  <route name="entity" url="/entity/([a-zA-Z]+)(/*)" action="entity" vars="entity"/>
</group>

Licence :

licence MIT, (*5)

The Versions

31/05 2018

dev-master

9999999-dev

GCsystem PHP Framework scaffolding plugin

  Sources   Download

MIT

The Requires

  • php >=5.6

 

framework gcsystem