PHPackages                             herrera-io/silex-bootstrap - 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. herrera-io/silex-bootstrap

AbandonedArchivedProject[Framework](/categories/framework)

herrera-io/silex-bootstrap
==========================

A Silex bootstrap project.

1.0.1(12y ago)4642MITCSSPHP &gt;=5.4.0

Since Aug 22Pushed 12y agoCompare

[ Source](https://github.com/kherge-archive/php-silex-bootstrap)[ Packagist](https://packagist.org/packages/herrera-io/silex-bootstrap)[ Docs](https://github.com/herrera-io/php-silex-bootstrap)[ RSS](/packages/herrera-io-silex-bootstrap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (20)Versions (3)Used By (0)

Silex Bootstrap
===============

[](#silex-bootstrap)

[![Build Status](https://camo.githubusercontent.com/0155cc9d4460bc0fa900782505d9dce813240ed64726da52db03b7f88674f460/68747470733a2f2f7472617669732d63692e6f72672f686572726572612d696f2f7068702d73696c65782d626f6f7473747261702e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/herrera-io/php-silex-bootstrap)

This is a pre-made web application built on the [Silex](http://silex.sensiolabs.org/) micro-framework and the [Bootstrap](http://getbootstrap.com/2.3.2/) front-end framework. The web application is ready to launch and requires minor alterations to get a new project up and running. I suggest acquiring a solid understanding of Silex and Bootstrap before proceeding.

To create a new project, run:

```
$ composer create-project herrera-io/silex-bootstrap myProject/

```

Configuration
-------------

[](#configuration)

### Locations

[](#locations)

First, you need to know that parameters, services, and routes are configured by using [YAML](http://www.yaml.org/) configuration files. These files are loaded through the [`WiseServiceProvider`](https://github.com/herrera-io/php-silex-wise) service provider in the default environment, `prod`:

> If you know how the service provider works, you will also know that you can completely change the file format used. Instead of using YAML, you can use JSON, XML, INI, or just plain PHP. YAML was used since most of this bootstrap project is already based on Symfony, which heavily uses YAML.

WhatWhereparameters`app/config/parameters.yml`services`app/config/services.yml`routes`app/config/routes.yml`For all other environments that are not named `prod`, configuration files will have the name of their environment appended to the end of them, but before the file extension:

WhatWhereparameters`app/config/parameters_*.yml`services`app/config/services_*.yml`routes`app/config/routes_*.yml`### Environments

[](#environments)

The active environment is controlled by the `APP_MODE` environment variable. When the variable is not set, the default value of `prod` is used. Currently, the web application only recognizes three environments:

- `prod` — Used for live, production web applications.
- `dev` — Used for debugging the web application.
- `test` — Used for running `PHPUnit` test suites.

If you intend to use `dev`, `test`, or any other mode intended for debugging or testing, you will also want to set the `APP_DEBUG` variable to `1` (one). This will enable debugging mode in Silex.

### Configuring

[](#configuring)

The `parameters.yml` file defines the application-wide parameters that are set directly in the Silex instance. Because of how parameters are set in Silex, you must be careful not to accidentally replace services that use the same name as one or more of your parameters.

Once the application-wide parameters have been loaded and set, services are registered from `services.yml`, followed by the routes in `routes.yml`. To understand how these are configured, you must read up on the documentation for the [`WiseServiceProvider`](https://github.com/herrera-io/php-silex-wise).

### Defaults

[](#defaults)

These are the services registered by default:

- `Silex\Provider\FormServiceProvider`
- `Silex\Provider\MonologServiceProvider`
- `Silex\Provider\SessionServiceProvider`
- [`Herrera\Silex\Provider\TranslationServiceProvider`](https://github.com/herrera-io/php-silex-translation-files)
- `Silex\Provider\TwigServiceProvider`
- `Silex\Provider\UrlGeneratorServiceProvider`
- `Silex\Provider\ValidatorServiceProvider`

The following services are also registered when the `dev` environment is used:

- `Silex\Provider\ServiceControllerServiceProvider`
- `Silex\Provider\WebProfilerServiceProvider`

The `test` environment will actually unregister the `WebProfilerServiceProvider`.

### Customizing

[](#customizing)

The `Herrera\Silex\Application` class uses three methods for loading parameters, services, and routes. These methods can be replaced or extended if configuring through files is found to be inadequate.

- `registerDefaultParameters()` — Loads the parameters.
- `registerDefaultServices()` — Loads the services.
- `registerDefaultRoutes()` — Loads the routes.

It is likely that you will find that you cannot properly register one or more services through a configuration file. For cases such as these, you will want to do something like the following in your own `Application` subclass:

```
use Herrera\Silex\Application;

/**
 * My custom version of the bootstrap application class.
 *
 * @author Example User
 */
class MyApplication extends Application
{
    /**
     * {@override}
     */
    protected function registerDefaultServices()
    {
        parent::registerDefaultServices();

        // my custom registrations
    }
}
```

> You may also just modify the application class in `src/lib/Herrera/Silex/Application`, instead of creating a new subclass. This may be more convenient for you, but it could complicate maintenance when updates are released to this project.

If you create your own subclass, you will need to modify a few instances where the original class is used:

1. In `src/lib/Herrera/Silex/Test/TestCase.php`, you will need to modify the `TestCase->createApplication()` method so that it returns an instance of your class, instead of the default one.
2. In `web/index.php`, you will need to modify the call to the method `Herrera\Silex\Application::create()` so that it calls the same method on your class: `Example\Subclass::create()`

Console
-------

[](#console)

The web application provides console support through the [Go](https://github.com/herrera-io/php-go) build tool. You can add, edit, and remove your own tasks by editing the `Gofile` in the root directory.

These are the default tasks:

CommandDescription`app:clear`Removes the contents of `app/cache` and `app/logs`.`app:clear:cache`Removes the contents of `app/cache`.`app:clear:logs`Removes the contents of `app/logs`.`app:generate:docs`Uses [Sami](http://sami.sensiolabs.org) to generate API documentation.`app:minify`Uses [Minify](https://github.com/mrclay/minify) to minify JS and CSS assets.`app:run`Runs your web application using the [built-in server](http://php.net/manual/en/features.commandline.webserver.php).`app:test`Uses [PHPUnit](http://phpunit.de/manual/current/en/automating-tests.html) to execute the test suite.### Sami

[](#sami)

By default, the Sami settings are in `app/config/docs.php`. Sami is configured so that the parsed data is stored in `app/cache/docs`, while the final rendered result is stored in `docs/` in the root directory.

To generate the API documentation:

```
$ bin/go app:docs

```

### Minify

[](#minify)

By default, the list of assets to minify is in `app/config/assets.yml`. The file is organized as an associative array. The key is the path where the minified file will be saved, and the value is an array of paths that will be minified.

To minify assets:

```
$ bin/go app:minify

```

### PHPUnit

[](#phpunit)

By default, the test cases are kept in `src/tests`. PHPUnit is also configured to automatically load classes from that directory if they are not present in the `src/lib` directory.

To launch PHPUnit:

```
$ bin/go app:test

```

To generate code coverage, simply pass the option `--coverage` (or `-c`). The task will take care of configuring PHPUnit so that the generated HTML coverage report is stored in `app/cache/coverage`.

Translations
------------

[](#translations)

By default, translation files are stored in `app/translations`. Also by default, the following translation files are registered with the translation service provider:

- `example.de.yml`
- `example.en.yml`
- `example.fr.yml`

To use your own translation files, I recommend reading the documentation on the `TranslationServiceProvider` service provider. The service provider will allow you do other things such as specify which loader class you need to register in order to load your translation files. This means you can use other formats, such as XLIFF, instead of YAML.

Front-End
---------

[](#front-end)

The front-end is built using the following:

- Bootstrap 2.3.2
- [Font Awesome](http://fontawesome.io/) 3.2.1
- jQuery 1.10.2
- [jQuery Migrate](https://github.com/jquery/jquery-migrate#readme) 1.2.1
- [Twig](http://twig.sensiolabs.org/) 1.9+

A custom form theme has also been supplied to make using the horizontal form design very simple to use. All form types recognized by Bootstrap are supported by the theme.

```
{% extends "layout.html.twig" %}

{% form_theme myForm "form.html.twig" %}

{% block content %}

          Example Form
          {{ form(form) }}

{% endblock %}
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4642d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9122157?v=4)[Kevin Herrera](/maintainers/kherge)[@kherge](https://github.com/kherge)

---

Top Contributors

[![kherge](https://avatars.githubusercontent.com/u/9122157?v=4)](https://github.com/kherge "kherge (90 commits)")[![appus50](https://avatars.githubusercontent.com/u/1609628?v=4)](https://github.com/appus50 "appus50 (1 commits)")

---

Tags

bootstrapsilex

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/herrera-io-silex-bootstrap/health.svg)

```
[![Health](https://phpackages.com/badges/herrera-io-silex-bootstrap/health.svg)](https://phpackages.com/packages/herrera-io-silex-bootstrap)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
