> Symfony 3 >

Course Overview

Login to bookmark this course

The Symfony Micro-Framework

Dive into the depths of Symfony with this tutorial, and create a powerful single-file micro-framework.

  • 1126 students
  • EN Captions
  • EN Script
  • Certificate of Completion

Your Guides

About this course

What PHP libraries does this tutorial use?

// composer.json
{
    "require": {
        "symfony/symfony": "^2.7", // v2.7.2
        "sensio/framework-extra-bundle": "^3.0", // v3.0.9
        "vlucas/phpdotenv": "^2.0", // v2.0.1
        "symfony/monolog-bundle": "^2.7" // v2.7.1
    }
}

NOTE Symfony 4 makes this course deprecated this course, as it is itself a micro framework! In fact, several of the things done in this tutorial were adopted in the core of Symfony. So, stay tuned! Or, watch this tutorial to learn more about the depths of Symfony.

So you love microframeworks like Silex. Yep - me too. Being able to create a single file and immediately code up some routes is awesome.

But Symfony is a big framework, right? Wrong! Symfony can be as small as a single file!

In this tutorial, we'll bootstrap a project using Symfony as a micro-framework: something that looks more like Silex, but with the tools you're used to. This means:

  • Small: A project structure with very few files
  • Simple: Create pages by touching one file
  • Familiar: It's still Symfony :)
  • Powerful: Enable/disable any bundles you need
  • Evolve: Grow from micro to full-sized as your app succeeds

So if your next project is perfect for a micro-framework, you can still use Symfony.

Oh, and thanks to Benjamin Eberlei for his blog post and work - Symfony All The Things (Web) that served as motivation.

Next courses in the Symfony 3: Young Jedi section of the Symfony 3 Track!

4 Comments

Sort By
Login or Register to join the conversation
JuanLuisGarciaBorrego avatar JuanLuisGarciaBorrego 6 years ago

Hello, Ryan!
A dude.., the version of symfony 2.8 that comes with the option of micro-framework that is like this?

This ready to use or you have to shape it as in this tutorial?

Another question, if I want to put here ORM doctrine, as you would?

Thank you

Greetins

| Reply |

Hey Juan!

Sorry for the late reply - SymfonyCon key me busy last week :). Symfony 2.8 comes with the MicroKernelTrait (obviously), but there is no official starting "project" (like the Symfony Standard Edition) that uses the MicroKernelTrait out of the box. I assume that some community member will probably support this. I don't know if there will ever be an official version, as it's sometimes difficult if you give people (especially beginners) too many options :). Here is an example starting project using it: https://github.com/CawaKhar...

To include Doctrine ORM, what you would need to do is:

1) Add DoctrineBundle to your kernel
2) Configure it. That basically means, somehow include the normal "doctrine" config.yml configuration in your project.
3) Have a bundle. On this project, I never include a bundle. But, it's much easier to use Doctrine if you have an AppBundle :).

Cheers!

| Reply |
JuanLuisGarciaBorrego avatar JuanLuisGarciaBorrego weaverryan 6 years ago

No problem, I know your were in SymfonyCon =), good slides!!
As it will be as Silex, when our app grow ... we need to configure it.

Thanks for you reply.
greetins!

| Reply |

Ha yes, you understand it perfectly :). Cheers!

| Reply |

Delete comment?

Share this comment

astronaut with balloons in space

"Houston: no signs of life"
Start the conversation!