2017 © Pedro Peláez
 

symfony-bundle distribution-bundle

This bundles ships convenience methods, helpers, utils and a simple runtime admin generator based on the Sensio CodeGenerators.

image

simplethings/distribution-bundle

This bundles ships convenience methods, helpers, utils and a simple runtime admin generator based on the Sensio CodeGenerators.

  • Wednesday, September 4, 2013
  • by beberlei
  • Repository
  • 0 Watchers
  • 0 Stars
  • 166 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SimpleThings Distribution Bundle

Repository Service Detector

The bundle ships a dependency injection extension that automatically detects services for the repositories of Doctrine ORM entities. The convention for registration is '{bundle_alias}.repository.{entity}', everything in lowercase., (*1)

Controller Utils

The service simple_things.distribution.controller_utils implements all the methods that the Base Controller of the Framework Bundle has with the following exceptions:, (*2)

* No access to the container possible through `has()` and `get()`
* Added method `getRestView()` to access the fos_rest.view service if defined.
* Added methods `isPut()`, `isPost()`, `isDelete()` and `isXmlHttpRequest()`.
* Added methods `getUser()` and `isGranted($attributes, $object = null)` that checks for permissions
* Added methods for throwing more http related exceptions
* Added method `getSession()`
* Added method `getLogger()`

Controller

By Symfony2 default controllers are not service and services are grabbed through a service-locator approach by directly accessing the Symfony DI Container. This is very convenient, but leads to hard to maintain code in the long run., (*3)

This bundle ships a SimpleThings\DistributionBundle\Controller\Controller that is automatically registered as a service based on the "{bundle_alias}.controller.{controller_name}" convention. This controller is automatically injected the Controller#utils variable as the controller utils service., (*4)

For simplicity there is also Controller#__call implemented that delegates to the utils service for as much API compability as possible to the default controller., (*5)

use SimpleThings\DistributionBundle\Controller\Controller;

/**
 * Controller to access jira instances through a HTTP-JSON interface
 *
 * @Extra\Route(service="whitewashing.controller.jira")
 */
class JiraController extends Controller
{
    private $jiraFactory;

    public function __construct($jiraFactory)
    {
        $this->jiraFactory = $jiraFactory;
    }

    /**
     * @Extra\Route("/jira/projects", name="ww_jira_projects")
     * @Extra\Method("GET")
     */
    public function projectsAction(Request $request)
    {
    }
}

The Versions

04/09 2013

dev-master

9999999-dev

This bundles ships convenience methods, helpers, utils and a simple runtime admin generator based on the Sensio CodeGenerators.

  Sources   Download

MIT

The Requires

 

by Benjamin Eberlei

symfony2