PHPackages                             xsanisty/silexstarter - 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. [Admin Panels](/categories/admin)
4. /
5. xsanisty/silexstarter

ActiveLibrary[Admin Panels](/categories/admin)

xsanisty/silexstarter
=====================

A starter application based on Silex framework

111427CSS

Since Feb 20Pushed 5y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

\[[![Build Status](https://camo.githubusercontent.com/7f96bfe77b02031eb8a681592820e9000299d4f8d170a58b61d7a084dfaa9e93/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7873616e697374792f53696c6578537461727465722f6261646765732f6275696c642e706e673f623d646576656c6f70)](https://camo.githubusercontent.com/7f96bfe77b02031eb8a681592820e9000299d4f8d170a58b61d7a084dfaa9e93/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7873616e697374792f53696c6578537461727465722f6261646765732f6275696c642e706e673f623d646576656c6f70)\] () \[[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5e606612461958e24a4b4a09c1d52857f1a23a5172622ea92e1001f1e4ab18d4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7873616e697374792f53696c6578537461727465722f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)](https://camo.githubusercontent.com/5e606612461958e24a4b4a09c1d52857f1a23a5172622ea92e1001f1e4ab18d4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7873616e697374792f53696c6578537461727465722f6261646765732f7175616c6974792d73636f72652e706e673f623d646576656c6f70)\] () \[[![Code Coverage](https://camo.githubusercontent.com/a457e51cfc03b648dcbfe2ca25fbd02c008f0373d58a24a54b5aa272545c5c81/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7873616e697374792f53696c6578537461727465722f6261646765732f636f7665726167652e706e673f623d646576656c6f70)](https://camo.githubusercontent.com/a457e51cfc03b648dcbfe2ca25fbd02c008f0373d58a24a54b5aa272545c5c81/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7873616e697374792f53696c6578537461727465722f6261646765732f636f7665726167652e706e673f623d646576656c6f70)\] () \[[![SensioLabsInsight](https://camo.githubusercontent.com/538c6c77fe45bc05c528520e0b981d7451b645c4cefbdfb7aeac1a6cb0e94903/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61333061363666392d383131302d343063352d386133352d6633633136393764646535352f6d696e692e706e67)](https://camo.githubusercontent.com/538c6c77fe45bc05c528520e0b981d7451b645c4cefbdfb7aeac1a6cb0e94903/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61333061363666392d383131302d343063352d386133352d6633633136393764646535352f6d696e692e706e67)\] ()

[![screenshot](https://github.com/xsanisty/SilexStarter/raw/develop/screenshot.png)](https://github.com/xsanisty/SilexStarter/blob/develop/screenshot.png)

SilexStarter
============

[](#silexstarter)

SilexStarter is a starter application built on the top of Silex framework, Laravel's Eloquent, Cartalyst Sentry, and some other third party and built in components. SilexStarter aim to help building simple application faster, it built with MVC and modular approach in mind, and comes with some basic admin module, including user manager, and module manager.

Installation
------------

[](#installation)

For now, the installable branch is only develop branch, you can easily install it using composer by using following command

```
composer create-project xsanisty/silexstarter target_dir dev-develop -s dev

```

once composer install is completed, you can initialize the app using following command

```
$cd target_dir
$./xpress app:init

```

Module can be developed directly inside the `app/modules` directory and create module on its own namespace or build it as separate composer package, module can be enabled or disabled by registering it in `app/config/modules.php`

Route
-----

[](#route)

`file : app/routes.php`Route configuration can be created like normal Silex route, or using route builder using similar syntax like Laravel's route.

Silex routing style

```
/* the application instance is available as $app in context of route.php */

$app->get('/page', function(){
    return 'I am in a page';
});

$app->post('/save', function(){
   return 'Ok, all data is saved!';
});

/* grouping */
$app->group('prefix', function() use ($app) {
    $app->group('page', function() use ($app) {
        $app->get('index', function(){
            return 'I am in prefix/page/index';
        });
    });
});

/* resourceful controller */
$app->resource('prefix', 'SomeController');

/* route controller */
$app->controller('prefix', 'SomeController');
```

Laravel routing style

```
/* route can be built using the Route static proxy */

Route::get('/page', function(){
    return 'I am in a page';
});

Route::post('/save', function(){
   return 'Ok, all data is saved!';
});

/* grouping */
Route::group('prefix', function() {
    Route::group('page', function() {
        Route::get('index', function(){
            return 'I am in prefix/page/index';
        });
    });
});

/* resourceful controller */
Route::resource('prefix', 'SomeController');

/* route controller */
Route::controller('prefix', 'SomeController');
```

Controller
----------

[](#controller)

`file: app/controllers/*`

Controller basically can be any classes that reside in controllers folder, it will be registered as service when enabled, and will be properly instantiated when needed, with all dependency injected.

Assume we have `PostRepository` and `CommentRepository`, we should register it first before it can be properly injected into controller.

`file: app/services/RepositoryServiceProvider.php`

```
