PHPackages                             malukenho/silex-manager - 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. malukenho/silex-manager

ActiveLibrary[Framework](/categories/framework)

malukenho/silex-manager
=======================

A simple scaffold to create crap CRUD based application using Silex

34193[1 issues](https://github.com/malukenho/silex-manager/issues)PHP

Since May 22Pushed 9y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Silex Manager
=============

[](#silex-manager)

[![Build Status](https://camo.githubusercontent.com/7b091a0ab847917771a33302cbb552b20c1a5f9ddd8e764ed894094c74a68be0/68747470733a2f2f7472617669732d63692e6f72672f6d616c756b656e686f2f73696c65782d6d616e616765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/malukenho/silex-manager)

Silex Manager is a easy way to create crap CRUD based application. We know that CRUD based apps is so bad, but It's needed some times.

**Now you can create crap application in minutes**

[![Silex Manager](preview.png)](preview.png)

Author
------

[](#author)

- [Jefersson Nathan](https://github.com/malukenho)

Installing
----------

[](#installing)

You have to set the `minimum-stability` to `dev` and then run:

```
$ composer require malukenho/silex-manager

```

Requirements
------------

[](#requirements)

- twig/twig
- symfony/twig-bridge
- symfony/session
- symfony/form
- symfony/security-csrf
- symfony/translation

Usage
-----

[](#usage)

First of all, you need to register the `ManagerControllerProvider` to your `Silex\Application`. For now you should pass a `PDO` instance to the our provider.

```
$adapter = new \Manager\Db\Adapter\PdoAdapter($pdo);
$app->mount('/manager', new \Manager\Controller\ManagerControllerProvider($adapter));
```

When you install the `Silex Manager`, you don't need to install Silex, because it's already installed. And all dependencies is installed too. You just want to config this dependencies properly.

```
$app->register(new Provider\TwigServiceProvider(), [
    // Use this path to load the default views (It's use semantic-ui from CDN)
    'twig.path' => __DIR__ . '/vendor/malukenho/silex-manager/views',
]);

$app->register(new Provider\UrlGeneratorServiceProvider());
$app->register(new Provider\SessionServiceProvider());
$app->register(new Provider\ServiceControllerServiceProvider());
$app->register(new Provider\FormServiceProvider());
$app->register(new Provider\ValidatorServiceProvider());
$app->register(new Provider\TranslationServiceProvider(), [
    'translator.domains' => [],
]);
```

Routes
------

[](#routes)

RouterBind/{dbTable}/page/{pageNumber}manager-index/{dbTable}/newmanager-new/{dbTable}/edit/{id}manager-edit/{dbTable}/delete/{id}manager-delete### Configurations

[](#configurations)

You have to put some configuration on `$app['manager-config']` to make use of power from Silex Manager.

Bellow you can see an example how to make a basic configuration. Note that `users` refers to the name of table, and this is including a file to configure the interface/callbacks/fields.

```
$app['manager-config'] = [
    // Inside the `manager` key we have config for tables
    'manager' => [
        'users' => require __DIR__ . '/config/users.php',
    ],
    // Configuration pointing to default view
    // You can use your own views
    'view'    => [
        'index' => 'manager-index.twig',
        'new'   => 'manager-new.twig',
        'edit'  => 'manager-edit.twig',
    ],
];
```

Let's look at the `index` action on `/config/users.php` config definition file.

```
return [

    // List action
    'index' => [
        // Define columns
        // column name on db => label
        'columns' => [
            'id'    => 'Id',
            'name'  => 'Name',
            'email' => 'Email',
        ],
        // Modifies how the colums value is showed up
        'modifier' => [
            'id' => function (array $data) {
                return '#' . $data['id'];
            },
        ],
        // Set a primary key name, It's ID by default
        'pk' => 'id',
        // UI page header
        'header' => 'Manager users',
         // UI page icon
        'icon'   => 'user',
        // Allow pagination
        'pagination' => true,
        // Show items per page
        'item_per_page' => 10,
        // Actions allowed
        'action' => [
            'new' => 'Create a new user',
            'edit' => 'Edit',
            'delete' => 'Delete',
        ],
        // Configuration for search field
        'search' => [
            'input' =>[
                [
                    'name' => 'name',
                    'placeholder' => 'Find by name',
                ],
            ],
            'button' => 'Filter'
        ],
    ],
];
```

New form
--------

[](#new-form)

One interesting thing that you can do when sent a form, is call `before`, and `after` functions, that allows you to execute things before the form is processed and after it respectively.

```
'before' => function (array $data) use ($app) {

    if ($app['auth.model']->hasStudentWithMail($data['email'])) {
        $app['session']->getFlashBag()->add(
            'messageError',
            'Email já cadastrado, por favor escolha outro email.'
        );

        $url = $_SERVER['REQUEST_URI'];

        header("Location: {$url}");
        exit;
    }
},
```

### Custom queries

[](#custom-queries)

Sometimes you will need make a custom query to show data on the list page. This is possible by setting the key `query`.

```
$app['manager-config'] = [
    'manager' => [
        'users' => [
            'index' => [
                'query' => 'SELECT * FROM users u INNER JOIN user_admin ua ON u.id = ua.id',
            ],
        ],
    ],
];
```

### Actions

[](#actions)

Missing documentation

### Views

[](#views)

Currently We provide simples views. You can take a look at `views` folder to implements your owns presentation files. New presentation files can be configured by follow directive.

```
```

### Columns

[](#columns)

Missing documentation

### Before

[](#before)

Missing documentation

### After

[](#after)

Missing documentation

### Custom names

[](#custom-names)

Missing documentation

### Modifiers

[](#modifiers)

Missing documentation

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7140a8c7b834b07674c6bd74d6cb75792522ceba17dfb1f347489083a0ba1c48?d=identicon)[malukenho](/maintainers/malukenho)

---

Top Contributors

[![EmanueleMinotto](https://avatars.githubusercontent.com/u/417201?v=4)](https://github.com/EmanueleMinotto "EmanueleMinotto (4 commits)")[![danizord](https://avatars.githubusercontent.com/u/1850941?v=4)](https://github.com/danizord "danizord (1 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (1 commits)")

### Embed Badge

![Health badge](/badges/malukenho-silex-manager/health.svg)

```
[![Health](https://phpackages.com/badges/malukenho-silex-manager/health.svg)](https://phpackages.com/packages/malukenho-silex-manager)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M191](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M256](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M592](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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