bitkorn/code-create

Create Module, Data Entity, Controller with Factory, Table with Factory

dev-master 2019-05-19 00:00 UTC

This package is auto-updated.

Last update: 2025-03-14 10:12:31 UTC


README

CodeCreate creates:

  • Controller (REST, AJAX, HTML)
    • Factory
    • module.config.php: controllers->factories
  • Table
    • Factory
    • module.config.php: service_manager->factories
  • Form
    • Factory
    • module.config.php: service_manager->factories
  • Service
    • Factory
    • module.config.php: service_manager->factories

install instructions

require module \Bitkorn\Trinket

Syntax highlighting with prism

Some with jQuery & jQuery UI

Trial trinket

For Zend way (laminas/laminas-code):

composer require laminas/laminas-code

To generate Config Array (laminas/laminas-config):

composer require laminas/laminas-config

For Nette way (nette/php-generator, doc.nette.org/en/3.0/php-generator):

composer require nette/php-generator

doc.nette.org

use CodeCreate

To use CodeCreate

  • all is PSR-4
  • folder structure is ZF3
    • e.g. the Module.php is in /src
  • you will have a extra config file
    • SomeModule/config/codecreate.config.php
    • file owner must be the webserver user (e.g. www-data)

And in Module.php you will merge the configs:

public function getConfig()
{
    return ArrayUtils::merge(include __DIR__ . '/../config/module.config.php', include __DIR__ . '/../config/codecreate.config.php');
}