
If you have not once started new projects using Silex, then you know that every time at the beginning you need to configure it for yourself: add providers, redefine some services, define the directory structure, etc. Over time, you have a basic set for Silex that you use to create a new project.
But if you do not have it, I suggest you familiarize yourself with mine:
Silicone Skeleton .
The following components are included in Silicone Skeleton:
- HttpCache - works only in prod environment.
- Class Controllers - you can place controller code not only in functions, but also in class methods.
- Doctrine Common - delivered separately because used in several independent providers.
- Doctrine ORM - you can use a full-fledged ORM (and not just DBAL). The following commands have been added for work:
- database: create
- database: drop
- schema: create
- schema: update
- schema: drop
- Monolog - logs are written in app / open / log / log.txt
- Session
- Twig - templates are in app / view /
- Translation - language files (yml, xliff) are in app / lang / [domain]. [Locale] .yml
- Validators - Added missing validator UniqueEntityValidator for Doctrine Orm
- Forms
- Security - with user registration and authorization
- Annotation Routes - you can use annotations for routes and ORM.
- Console - the necessary commands for ORM and clearing the cache.
The directory structure is very close with symfony
app/ config/ -- lang/ -- open/ -- , src/ -- vendor/ -- view/ -- console -- web/ index.php
You can use regular Silex controllers: $ app-> get (...) together with such controllers:
class Blog extends Controller { public function post($post) { return $this->render('post.twig'); } }
')
Also in Silicone Skeleton, the Security Provider is fully configured. And the login and registration controller.
To install, use Composer:
composer create-project elfet/silicone-skeleton your/app/path
Anyone wishing to help with the development is welcome!