gnugat/micro-framework-bundle

Symfony Micro Framework Bundle

Installs: 10 608

Dependents: 1

Suggesters: 0

Security: 0

Stars: 37

Watchers: 2

Forks: 3

Open Issues: 0

Type:symfony-bundle

v0.9.4 2024-11-29 17:21 UTC

This package is auto-updated.

Last update: 2024-11-29 17:22:14 UTC


README

A replacement of the official FrameworkBundle allowing Symfony to be used as a micro-framework which follows the "add what you need" philosophy.

Installation

First install it using Composer:

composer require gnugat/micro-framework-bundle:^0.9

Then enable it in your application, for example by adding it in config/bundles.php:

<?php

return [
    \Gnugat\MicroFrameworkBundle\GnugatMicroFrameworkBundle::class => ['all' => true],
];

Next, set up autowiring / autoconfigure in `config/services.yaml:

services:
    _defaults:
        autowire: true
        autoconfigure: true

    App\:
        resource: '../src/'
        exclude:
            - '../src/DependencyInjection/'
            - '../src/Entity/'
            - '../src/AppKernel.php'

    # Controllers have to be marked as "public"
    App\Controller\:
        resource: '../src/Controller/'
        public: true

Finally enable Routing Attributes in config/routings/attributes.yaml:

controllers:
    resource:                  
        path: ../../src/Controller/     
        namespace: App\Controller       
    type: attribute

More information

Features

  • compatible with most third party bundles, more information
  • micro framework spirit, including:
    • "add what you need" philosohpy
    • few dependencies
    • small API
    • small footprint for better performance
    • more information
  • supports autowiring/autoconfiguration
  • supports Routing Attributes
  • there are however some intentional incompatibilities, more information

Want to know more?

You can see the current and past versions using one of the following:

And finally some meta documentation:

Note: Some logic has been taken from Symfony FrameworkBundle and modified, all attributions go to Fabien Potencier and the contributors.