nedwave/rest-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Nedwave Rest Bundle

This package has no released version yet, and little information is available.


README

Nedwave Rest Bundle

Installation

Install package with composer

"nedwave/rest-bundle": "*"

Register bundles in AppKernel

new Nedwave\RestBundle\NedwaveRestBundle(),

Update config.yml

framework
    serializer:
        enabled: true

Extend your controllers for use of the json action

<?php

namespace Acme\DemoBundle\Controller;

use Nedwave\RestBundle\Controller\RestController;

class DefaultController extends RestController
{
    public function indexAction()
    {
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('AcmeDemoBundle:Post')->findAll();

        return $this->json($entities);
    }
}