PHPackages                             marks12/restgeneratorbundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. marks12/restgeneratorbundle

ActiveSymfony-bundle[API Development](/categories/api)

marks12/restgeneratorbundle
===========================

REST API Generator for Symfony 2

0.4.6(9y ago)057MITPHPPHP &gt;=5.3.0

Since Jul 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/marks12/restgeneratorbundle)[ Packagist](https://packagist.org/packages/marks12/restgeneratorbundle)[ RSS](/packages/marks12-restgeneratorbundle/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (5)Versions (12)Used By (0)

Attention
=========

[](#attention)

IT IS JUST TEST. DON`T USE THIS BUNDLE. IT IS BAD AND NOT WORKING. Please use marks12/restgeneratorbundle

About
-----

[](#about)

A CRUD like REST Generator

Features
--------

[](#features)

- Generators RESTful action from entity
- Simplifies setting up a RESTful Controller

Installation
------------

[](#installation)

Require the "marks12/restgeneratorbundle" package in your composer.json and update your dependencies.

```
$ php composer.phar require marks12/restgeneratorbundle dev-master
```

Add the Marks12RestGeneratorBundle to your application's kernel along with other dependencies:

```
public function registerBundles()
{
    $bundles = array(
        //...
          new Marks12\RESTGeneratorBundle\Marks12RESTGeneratorBundle(),
          new FOS\RestBundle\FOSRestBundle(),
          new JMS\SerializerBundle\JMSSerializerBundle($this),
          new Nelmio\CorsBundle\NelmioCorsBundle(),
        //...
    );
    //...
}
```

Configuration
-------------

[](#configuration)

This bundle depends on a number of other Symfony bundles, so they need to be configured in order for the generator to work properly

```
framework:
    csrf_protection: false #only use for public API

fos_rest:
    routing_loader:
        default_format: json
    param_fetcher_listener: true
    body_listener: true
    #disable_csrf_role: ROLE_USER
    body_converter:
        enabled: true
    view:
        view_response_listener: force

nelmio_cors:
    defaults:
        allow_credentials: false
        allow_origin: []
        allow_headers: []
        allow_methods: []
        expose_headers: []
        max_age: 0
    paths:
        '^/api/':
            allow_origin: ['*']
            allow_headers: ['*']
            allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
            max_age: 3600

sensio_framework_extra:
    request: { converters: true }
    view:    { annotations: false }
    router:  { annotations: true }
```

Generating the Controller
-------------------------

[](#generating-the-controller)

Generate the REST controller

```
$ php app/console marks12:generate:rest
```

This will guide you through the generator which will generate a RESTful controller for an entity.

Example
-------

[](#example)

Create a new entity called 'Post':

```
$ php app/console doctrine:generate:entity --entity=AppBundle:Post --format=annotation --fields="name:string(255) description:string(255)" --no-interaction
```

Update the database schema:

```
$ php app/console doctrine:schema:update --force
```

Generate the API controller:

```
$ php app/console marks12:generate:rest --entity="AppBundle:Post"
```

### Using the API

[](#using-the-api)

If you selected the default options you'll be able to start using the API like this:

Creating a new post (`POST`)

```
$ curl -i -H "Content-Type: application/json" -X POST -d '{"name" : "Test Post", "description" : "This is a test post"}' http://localhost/app_dev.php/api/posts
```

Updating (`PUT`)

```
$ curl -i -H "Content-Type: application/json" -X PUT -d '{"name" : "Test Post 1", "description" : "This is an updated test post"}' http://localhost/app_dev.php/api/posts/1
```

Get all posts (`GET`)

```
$ curl http://localhost/app_dev.php/api/posts
```

Get one post (`GET`)

```
$ curl http://localhost/app_dev.php/api/posts/1
```

Delete (`DELETE`)

```
$ curl -X DELETE  http://localhost/app_dev.php/api/posts/1
```

Related Entities
----------------

[](#related-entities)

If you want the form to be able to convert related entities into the correct entity id on POST, PUT or PATCH, use the marks12\_entity form type

```
#Form/PostType()

    ->add(
        'user', 'marks12_entity', array(
            'class' => 'Acme\Bundle\Entity\User'
        )
    )
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Recently: every ~0 days

Total

11

Last Release

3527d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d347036e76bae8d4433d39d3752ce159e663475f9f03e5d72bb1dd1a8f502c4d?d=identicon)[marks12](/maintainers/marks12)

---

Top Contributors

[![davidwdan](https://avatars.githubusercontent.com/u/4969183?v=4)](https://github.com/davidwdan "davidwdan (31 commits)")[![mbonneau](https://avatars.githubusercontent.com/u/748287?v=4)](https://github.com/mbonneau "mbonneau (10 commits)")[![Ninir](https://avatars.githubusercontent.com/u/855022?v=4)](https://github.com/Ninir "Ninir (5 commits)")[![cezar77](https://avatars.githubusercontent.com/u/7045848?v=4)](https://github.com/cezar77 "cezar77 (2 commits)")[![kuldipem](https://avatars.githubusercontent.com/u/2017625?v=4)](https://github.com/kuldipem "kuldipem (2 commits)")[![marks12](https://avatars.githubusercontent.com/u/3445654?v=4)](https://github.com/marks12 "marks12 (2 commits)")[![aivus](https://avatars.githubusercontent.com/u/1021703?v=4)](https://github.com/aivus "aivus (1 commits)")[![vishalmelmatti](https://avatars.githubusercontent.com/u/1233269?v=4)](https://github.com/vishalmelmatti "vishalmelmatti (1 commits)")[![ilario-pierbattista](https://avatars.githubusercontent.com/u/987038?v=4)](https://github.com/ilario-pierbattista "ilario-pierbattista (1 commits)")[![maco222](https://avatars.githubusercontent.com/u/14107069?v=4)](https://github.com/maco222 "maco222 (1 commits)")[![maxpowel](https://avatars.githubusercontent.com/u/529550?v=4)](https://github.com/maxpowel "maxpowel (1 commits)")[![mhor](https://avatars.githubusercontent.com/u/4103719?v=4)](https://github.com/mhor "mhor (1 commits)")[![Moulino](https://avatars.githubusercontent.com/u/9279455?v=4)](https://github.com/Moulino "Moulino (1 commits)")

### Embed Badge

![Health badge](/badges/marks12-restgeneratorbundle/health.svg)

```
[![Health](https://phpackages.com/badges/marks12-restgeneratorbundle/health.svg)](https://phpackages.com/packages/marks12-restgeneratorbundle)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[voryx/restgeneratorbundle

REST API Generator for Symfony 2

177142.7k1](/packages/voryx-restgeneratorbundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
