sandrokeil / code-generator
Zend Framework 2 (ZF2) code generator which generates form and input filter depending on database or doctrine 2 meta data.
Requires
- php: ~5.4
- zendframework/zend-code: ~2.3
- zendframework/zend-stdlib: ~2.3
Requires (Dev)
Suggests
- doctrine/orm: Doctrine\ORM if you want to generate classes from doctrine 2
- symfony/console: Symfony\Console if you want to generate classes from doctrine 2
- zendframework/zend-db: Zend\Db if you want to generate classes from zend framework 2 db
- zendframework/zend-modulemanager: Zend\ModuleManager to use default module configuration e.g. services
This package is auto-updated.
Last update: 2024-10-28 22:50:05 UTC
README
You want to concentrate on the important things in your project and do not waste time with standard goodies?
You want surefire input filter and forms depending on your database or doctrine 2 meta data?
You want forms and input filter that are universally used and combined?
This module comes to the rescue!
Zend Framework 2 code generator which generates form and input filter depending on database or doctrine 2 meta data. Create new forms and input filter in seconds with your namespace and parent class.
- Great foundations. Based on Zend Framework 2 and Doctrine 2
- Every change is tracked. Want to know whats new? Take a look at CHANGELOG.md
- Listen to your ideas. Have a great idea? Bring your tested pull request or open a new issue. See CONTRIBUTING.md
Installation
Installation of this module uses composer. For composer documentation, please refer to getcomposer.org.
Put the following into your composer.json
{
"require": {
"sandrokeil/code-generator": "dev-master"
}
}
Then add Sake\CodeGenerator
to your ./config/application.config.php
.
Documentation
Console Doctrine 2
Before you can use these doctrine commands please make sure you have enabled and configured your cli-config.php for doctrine. For a common example see cli-config.php of this repository.
zf:generate-form [--filter="..."] [--force] [--from-database] [--extend[="..."]] [--namespace[="..."]] [--num-spaces[="..."]] dest-path
Console Zend Framework 2
Generated Classes
At the moment the following classes can be generated:
- ZF2 Form Fieldsets (Collections)
- ZF2 Input Filter
Known limitations
Unfortunately is it necessary to change some generated code lines by yourself, because some information is currently missing to make some classes working out of the box.
Form Fieldsets (Collections)
If you have relations (foreign keys) defined in your entities the \DoctrineModule\Persistence\ObjectManagerAwareInterface
must be implemented by yourself. Additionally you must set property
option for the name of the text which should be
displayed in select box.