Silex Starter Stubs

There are several preconfigured Silex Apps on github. They let you start your Silex project in no time, which is good.
This makes Silex an even more simple rabbithole into the symfony2 world.

I started one myself and had a close look on the others, so i thought i share this.
They all differ a bit so you must choose what fits your needs the best.

They all follow some kind of “best practise” structure, some more, some less.

So there is: https://github.com/gcalore/Silex-Stub
This has several common Providers already enabled:

  • Twig
  • UrlGenerator
  • Monolog
  • Doctrine DBAL
  • Validator
  • Forms

but it has no Frontend Frameworks integrated.
Another minus point is that the index is not in a web directory but in root, so that all lib files etc. are potentially accessible from the web, thou a .htaccess avoids that here.
It also doesnt provide tests.
So i wouldnt recommend that one.

The next one is: https://github.com/brtriver/silex-sample-application
This is a sample rudimentary blog application that you could use as starter.
It has Doctrine and Twig build-in, it has tests but also doesnt include some frontend magic.

The most complete is: https://github.com/lyrixx/Silex-Kitchen-Edition
This starterkit has several extension enabled:

  • Doctrine
  • Form
  • Session
  • SymfonyBrige
  • Translation
  • Twig (with debug extension)
  • UrlGenerator

and it also has the HTML5Boilerplate and Twitter`s Bootstrap integrated.
Further Assetic and the YAMLLoader are already shipped and active and tests are provided aswell.
Here Silex is included as submodule, which means unpacked – hence not as phar-, which might be interesting for some.
In my Opinion this is some kind of a reference app, this is even more likely since the creator is sensio employee.
I stole a lot from it ;).

Last but not least mine ;) : https://github.com/ivoba/superleansilexplate
Its supposed to be very lean.
It comes just with Twig and Translation enabled.
It aims mainly at simple applications that need routing and just some additional logic. F.e. its a good container for javascript driven apps that get their data through API calls. If you need database support and more, simply register the provider yourself or use the kitchen.

Tests are included and for the frontend there is the a mix of skeleton(bootstrap seemed too verbose and too twitter branded for mi gusto) and HTML5boilerplate.
Also there is an optimized Boilerplate Build included to avoid Assetic.


Its not really finished yet, but sufficient to start with.
(feel free to provide some improvements)

2 Replies to “Silex Starter Stubs”

Leave a Reply

Your email address will not be published. Required fields are marked *