2017 © Pedro Peláez
 

library jbuilder-bundle

Symfony2 bundle for JBuilder

image

jbuilder/jbuilder-bundle

Symfony2 bundle for JBuilder

  • Thursday, January 14, 2016
  • by dakatsuka
  • Repository
  • 1 Watchers
  • 3 Stars
  • 12,427 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

JBuilderBundle Build Status

Symfony2/Symfony3 Bundle for JBuilder, (*1)

Installation

Add this lines to your composer.json:, (*2)

{
    "require": {
        "jbuilder/jbuilder-bundle": "~1.0"
    }
}

And then execute:, (*3)

$ php composer.phar install

And import a JBuilderBundle to AppKernel.php:, (*4)

$bundles = array(
    new JBuilder\JBuilderBundle\JBuilderJBuilderBundle(),
);

Usage

Insert the following code to controller:, (*5)

public function indexAction()
{
    $posts = $this->getDoctrine()->getRepository('Acme\BlogBundle\Entity\Post')->findAll();

    return $this->get('jbuilder')->render('AcmeBlogBundle:Post:index.json.php', array('posts' => $posts));
}

src/Acme/BlogBundle/Resources/views/Post/index.json.php:, (*6)

$json->buildArray($posts, function($json, $post) {
    $json->id    = $post->getId();
    $json->title = $post->getTitle();
});

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright (C) 2016 Dai Akatsuka, released under the MIT License., (*7)

The Versions

14/01 2016

dev-master

9999999-dev

Symfony2 bundle for JBuilder

  Sources   Download

MIT

The Requires

 

The Development Requires

json symfony2

14/01 2016

1.1.1

1.1.1.0

Symfony2 bundle for JBuilder

  Sources   Download

MIT

The Requires

 

The Development Requires

json symfony2

14/01 2016

1.1.0

1.1.0.0

Symfony2 bundle for JBuilder

  Sources   Download

MIT

The Requires

 

The Development Requires

json symfony2

21/05 2013

1.0.0

1.0.0.0

Symfony2 bundle for JBuilder

  Sources   Download

MIT

The Requires

 

The Development Requires

json symfony2