Giter Club home page Giter Club logo

silicone-skeleton's Introduction

Silicone Skeleton

Silicone Skeleton is Silex Framework Edition Skeleton.

Every part is configurable. You can choose anything you want.

This Silex modification contains the following:

  • HttpCache
  • Class Controllers
  • Doctrine Common
  • Doctrine ORM
  • Monolog
  • Session
  • Twig
  • Translation
  • Validator
    • Unique validator for entities
  • Forms
  • Security
  • User Registration and Authorization.
  • Annotation Routes
  • WebProfiler (with Doctrine queries logger)
  • Console

Structure

Structure of Silicone is very similar to Symfony's.

app/
    config/  -- Configuration
    lang/    -- Language Yml, Xliff files
    open/    -- Writable directory for caches, logs, ext.
    src/     -- Application sources
    vendor/  -- Vendors
    view/    -- Twig view files
    console  -- Console Tool
web/
    index.php

Controller

You can use Silex controllers $app->get(...) with class controllers.

class Blog extends Controller
{
    /**
     * @Route("/blog/{post}")
     */
    public function post($post)
    {
        return $this->render('post.twig');
    }
}

Doctrine ORM

You can use all Doctrine ORM functionality, not just DBAL. Create file app/src/Entity/Post.php:

namespace Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 */
class Post
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    protected $id;

    /**
     * @ORM\Column
     * @Assert\NotBlank()
     * @Assert\Length(min = "3", max = "1000")
     */
    protected $text;
}

After this just run:

app/console schema:update

Install

Use Composer to create a new project:

composer create-project elfet/silicone-skeleton your/app/path

Open directory used for writing caches, logs, ext. So you must give write permissions for www-data user. Example:

sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit" app/open/
sudo chmod +a "[your user name] allow delete,write,append,file_inherit,directory_inherit" app/open/

Add permissions to execute console command. Example:

chmod +x app/console

Database

After configuring console run the following commands to create sample database:

app/console database:create
app/console schema:create

TODO

  • Documentation
  • Tests
  • SwiftMailer

silicone-skeleton's People

Contributors

chapay avatar vetalt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silicone-skeleton's Issues

How to change the paramters for built-in ServiceProviders?

Hi,

i am sorry for opening an issue for that - but is there a better way to ask only questions? :) I am really happy i found your skeleton, now i want to proof if i can use it as base for a new project.

How can ich change the paramters that are passed if a ServiceProvider is register? Actually i have the problem that i want to set locale_fallback = 'de' for the TranslationServiceProvider.

Is it possible to change the variables after the ServiceProvider has been registered?

Greets and Thanks!
Roman

New to Symfony - I don't understand how role gets assigned upon login

I am rather new to Symfony. I appreciate the time you have put into to building this skeleton as it gives me a good starting point at understanding things. Howerver, I am trying to understand how the role gets assigned to the user once they are logged in. My basic need is that a user will wear many "hats":

  • User
  • Manager
  • Reporter

And I need to be able to use the isGranted to check multiple role types. If you could point me in the right direction, it would be appreciated.

I presume the user Entity is what is assigning the default role and I would simply do my assignment in the construct?

How to handle different requests to one url?

Hi!

Sorry, it's me again. ;-)

I want to handle different requests (POST, GET, PUT, etc.) to one url, for example /test.

All requests will be handled by the Test-controller und end up the function test($request).

Is there a way to create a function for each request-type as Silex does with

$app->get()
$app->post()
...

Add License

Please add License. We would like to use parts of this skeleton in our application.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.