Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iambrosi/ismaambrosigeneratorbundle
Generates Symfony2 documents, forms and CRUD for MongoDB documents
https://github.com/iambrosi/ismaambrosigeneratorbundle
bundle crud php symfony symfony-bundle
Last synced: about 2 hours ago
JSON representation
Generates Symfony2 documents, forms and CRUD for MongoDB documents
- Host: GitHub
- URL: https://github.com/iambrosi/ismaambrosigeneratorbundle
- Owner: iambrosi
- License: mit
- Created: 2012-01-20T10:48:31.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T16:56:02.000Z (over 7 years ago)
- Last Synced: 2024-11-18T14:16:41.949Z (about 20 hours ago)
- Topics: bundle, crud, php, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 207 KB
- Stars: 26
- Watchers: 4
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IsmaAmbrosiGeneratorBundle
[![Build Status](https://secure.travis-ci.org/iambrosi/IsmaAmbrosiGeneratorBundle.png?branch=master)](http://travis-ci.org/iambrosi/IsmaAmbrosiGeneratorBundle)
[![Total Downloads](https://poser.pugx.org/ismaambrosi/generator-bundle/downloads.png)](https://packagist.org/packages/ismaambrosi/generator-bundle)
[![Latest Stable Version](https://poser.pugx.org/ismaambrosi/generator-bundle/v/stable.png)](https://packagist.org/packages/ismaambrosi/generator-bundle)
[![Latest Unstable Version](https://poser.pugx.org/ismaambrosi/generator-bundle/v/unstable.png)](https://packagist.org/packages/ismaambrosi/generator-bundle)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/54e00601-0232-471a-ae8e-b5d534a3a819/mini.png)](https://insight.sensiolabs.com/projects/54e00601-0232-471a-ae8e-b5d534a3a819)This bundle extends the commands provided by [SensioGeneratorBundle](https://github.com/sensio/SensioGeneratorBundle), adding a MongoDB document generator and CRUD generators for those MongoDB documents.
Installation
------------### Add the bundle to your project.
Add the requirement to composer:
```bash
$ php composer.phar require ismaambrosi/generator-bundle
```You will also need to install the DoctrineMongoDBBundle. The instructions on how to install it are available in the Symfony2 [documentation](http://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/index.html).
### Enable the bundle in your kernel
```php
getEnvironment(), array('dev', 'test'))) {
// ...
$bundles[] = new IsmaAmbrosi\Bundle\GeneratorBundle\IsmaAmbrosiGeneratorBundle();
}
}
```
It is recommended to disable this bundle for the production environment.### Commands
This bundle contains three commands that will allow you to generate code for documents, forms and CRUD controllers. These commands can be executed either on interactive mode or manual mode. I would recommend you to use the interactive mode.
#### Generating ODM documents
The first command allows to generate the document classes.
Examples:
```bash
$ php app/console doctrine:mongodb:generate:document
``````bash
$ php app/console doctrine:mongodb:generate:document \
--document=AcmeBlogBundle:Blog/Post \
--with-repository
```#### Generating forms
With the second command we can generate the form type classes, used by the form component.
Example:
```bash
$ php app/console doctrine:mongodb:generate:form AcmeBlogBundle:Post
```#### Generating the CRUD
The last command generates the CRUD controllers, with read-only actions to handle the documents that were generated previously. It also allows to include the _write actions_, for creating, updating and deleting documents.
Examples:
```bash
$ php app/console doctrine:mongodb:generate:crud
``````bash
# Specifying the document and the routing prefix
$ php app/console doctrine:mongodb:generate:crud \
--document=AcmeBlogBundle:Post \
--route-prefix=post_admin
``````bash
# Specifying the document, routing and write-actions
$ php app/console doctrine:mongodb:generate:crud \
--document=AcmeBlogBundle:Post \
--route-prefix=post_admin --with-write
```