PHPackages                             bgaze/silex-skeleton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. bgaze/silex-skeleton

AbandonedArchivedProject[Framework](/categories/framework)

bgaze/silex-skeleton
====================

A pre-configured skeleton for the Silex microframework, based on fabpot/silex-skeleton

020PHP

Since Aug 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/bgaze/silex-skeleton)[ Packagist](https://packagist.org/packages/bgaze/silex-skeleton)[ RSS](/packages/bgaze-silex-skeleton/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Silex Skeleton
==============

[](#silex-skeleton)

Welcome to the Silex Skeleton - a fully-functional Silex application that you can use as the starting point for your Silex applications.

A great way to start learning Silex is via the [Documentation](http://silex.sensiolabs.org/documentation), which will take you through all the features of Silex.

This document contains information on how to start using the Silex Skeleton.

Install.
--------

[](#install)

```
$ composer create-project bgaze/silex-skeleton:dev-master path/to/install

```

Then give to PHP write permissions on `/var` directory (for logs and cache).

Browsing the Demo Application
-----------------------------

[](#browsing-the-demo-application)

To configure Silex on your local webserver, see [Webserver configuration documentation](https://silex.symfony.com/doc/2.0/web_servers.html).

To use the PHP built-in web server run :

```
$ cd path/to/install
$ COMPOSER_PROCESS_TIMEOUT=0 composer run

```

Then, browse to [http://localhost:8888/index\_dev.php/](http://localhost:8888/index_dev.php/)

Included service providers.
---------------------------

[](#included-service-providers)

Read the [Providers](http://silex.sensiolabs.org/doc/providers.html) documentation for more details about Silex Service Providers.

The Silex Skeleton is configured with the following service providers:

- [ValidatorServiceProvider](http://silex.sensiolabs.org/doc/master/providers/validator.html) : Provides a service for validating data. It is most useful when used with the FormServiceProvider, but can also be used standalone.
- [ServiceControllerServiceProvider](http://silex.sensiolabs.org/doc/master/providers/service_controller.html) - As your Silex application grows, you may wish to begin organizing your controllers in a more formal fashion. Silex can use controller classes out of the box, but with a bit of work, your controllers can be created as services, giving you the full power of dependency injection and lazy loading.
- [TwigServiceProvider](http://silex.sensiolabs.org/doc/master/providers/twig.html) - Provides integration with the Twig template engine.
- [WebProfilerServiceProvider](http://github.com/silexphp/Silex-WebProfiler) - Enable the Symfony web debug toolbar and the Symfony profiler in your Silex application when developing.
- [MonologServiceProvider](http://silex.sensiolabs.org/doc/master/providers/monolog.html) - Enable logging in the development environment.
- [FinderServiceProvider](https://github.com/bgaze/silex-finder-provider) - Find files and directories via an intuitive fluent interface.
- [ConsoleServiceProvider](https://github.com/bgaze/silex-console-provider) - A CLI application service provider for Silex.

Usage.
------

[](#usage)

This Silex implementation follows several convention.
Mainly, currently modified files should reside into `/src` folder.

Please find in this section more details about the organisation.

### Views.

[](#views)

Application views reside into `/src/views` folder.

Two templates are included :

- `base.html.twig` : a raw base template defining main blocks in a HTML page.
- `layout.html.twig` : an implementation of [Bootstrap 4 Stater Template](https://v4-alpha.getbootstrap.com/examples/starter-template/).
    It can be used to quick start your app, and as a pattern to build your own layout.

### Controllers.

[](#controllers)

Controllers reside into `/src/controllers` folder.
Any PHP file in this folder is automatically loaded.

> The application already contains a main controller mounted on the application root path.

Basically, to add a new controller :

- Use `controllers_factory` to generate a new controller.
- Add your actions.
- Mount the controller with the path you want.

Example :

```
