Silicone Skeleton - Customized Silex


    If you have repeatedly started new projects using Silex, then you know that every time in 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 environments.
    • Class Controllers - you can place controller code not only in functions, but also in class methods.
    • Doctrine Common - taken separately as used in several independent providers.
    • Doctrine ORM - you can use the full ORM (and not just DBAL). The following commands were added for work:
      1. database: create
      2. database: drop
      3. schema: create
      4. schema: update
      5. 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 UniqueEntityValidator validator for Doctrine Orm
    • Forms
    • Security - with user registration and authorization
    • Annotation Routes - You can use annotations for routes and ORMs.
    • Console - the necessary commands for ORM and clearing the cache.


    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
    {
        /**
         * @Route("/blog/{post}")
         */
        public function post($post)
        {
            return $this->render('post.twig');
        }
    }
    


    Also in Silicone Skeleton, the Security Provider is fully configured. And a login and registration controller.

    To install, use Composer:
    composer create-project elfet/silicone-skeleton your/app/path
    


    Everyone is welcome to help with development!

    Also popular now: