PHP Classes

Silex Enhanced: Silex with custom services providers.

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 79 All time: 10,129 This week: 673Up
Version License PHP version Categories
silex-enhanced 0.9MIT/X Consortium ...5.4PHP 5, Libraries
Description 

Author

This package provides a skeleton for Silex framework based application.

It can read YAML configuration files and load custom service providers in a Silex deployment based on the configuration definitions.

It can be used for either Web or console applications.

Picture of Rafael Espinosa
  Performance   Level  
Innovation award
Innovation award
Nominee: 1x

 

Details

Silex Enhanced

A simple web framework for bootstrap web and console applications. For further details check Silex documentation.

On Silex Enhanced almost everything works based on config. The config files are located under app/Resources/config. Like Symfony2 supports import resources and parameters replacement.

Installing

Prerequisites

  • PHP version >5.4
  • Apache2 web server or similar
  • Composer
  • Bower ### Deploying
  1. Clone Silex Enhanced project with git.
  2. Run `composer update` and `bower update`.
  3. Run `php bin/console assets:install` command from console.
  4. Configure your web server, create a virtual host with `path/to/project/web` as document root.
  5. Set web server write permissions.
    Ubuntu example:
    sudo chmod -R 775 path/to/project/var && sudo chown -R www-data:www-data path/to/project/var
    
  6. Access your project url with web browser.

Configuration

config.yml

All common configs shared by both, console and web applications. Put your service providers under service_providers section.

 service_providers:
    monolog:
        class: Silex\Provider\MonologServiceProvider
        construct_parameters: ~
        parameters:
            monolog.logfile: %log_path%/common.log
            monolog.name: COMMON
 ...

console.yml \& application.yml

The console and web bootstrap config respectively. If you use imports statement the config will be merged recursively allows partial specific configs.

parameters.yml

Values for config parameters substitution. On application code parameters are accessible through Fluency\Silex\Application instance $app->getParameter('parameterName') or $app['config']['parameters'].

routing.yml

Holds controller service names and routes for binding.

 routing:
     controllers:
         My.Controller.Service.Name: My\Controller\Class\Name
    routes:
        - { name: my_route_name, pattern: route_pattern, controller: My.Controller.Service.Name:MyAction, method: get }

security.yml

The security firewalls and access control config. All information about it's available here.

Acme demo

Simple Bootstrap 3 based demo using Xeon template from Shape Bootstrap.


  Files folder image Files (127)  
File Role Description
Files folder imageapp (1 file, 1 directory)
Files folder imagebin (1 file)
Files folder imagesrc (2 directories)
Files folder imagevar (2 directories)
Files folder imageweb (4 files, 1 directory)
Accessible without login Plain text file .bowerrc Data Bower config
Accessible without login Plain text file .gitignore Data Auxiliary data
Accessible without login Plain text file bower.json Data Bower dependencies
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. Auxiliary data
Accessible without login Plain text file README.md Doc. Auxiliary data

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 81%
Total:79
This week:0
All time:10,129
This week:673Up