PHPackages                             the-matrix/slim-dic-example - 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. the-matrix/slim-dic-example

ActiveLibrary[Framework](/categories/framework)

the-matrix/slim-dic-example
===========================

A Slim Framework skeleton application utilising Symfony DIC to create a super thin MVC

3.0.0(8y ago)4501GPL-3.0-or-laterPHPPHP ~5.6|~7.1

Since Mar 2Pushed 8y ago3 watchersCompare

[ Source](https://github.com/the-matrix/Slim-Dic-Example)[ Packagist](https://packagist.org/packages/the-matrix/slim-dic-example)[ Docs](http://zf4.biz/packages?utm_source=packagist&utm_medium=web&utm_campaign=blinks&utm_content=slimdicexample)[ RSS](/packages/the-matrix-slim-dic-example/feed)WikiDiscussions master Synced 1mo ago

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

the-matrix/slim-dic-example
===========================

[](#the-matrixslim-dic-example)

[![PHP 5.6](https://camo.githubusercontent.com/88093c79af42bd3c07f4d6aa378289e1f5450411c56753b0323bd7d8b9b1f9ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d352e362d626c75652e737667)](https://camo.githubusercontent.com/88093c79af42bd3c07f4d6aa378289e1f5450411c56753b0323bd7d8b9b1f9ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d352e362d626c75652e737667)[![PHP 7.1](https://camo.githubusercontent.com/d23ce60b89c28c023d0ca69981ec9afbb17eb08a9cd1b609fd84c15d0732b7ce/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372d626c75652e737667)](https://camo.githubusercontent.com/d23ce60b89c28c023d0ca69981ec9afbb17eb08a9cd1b609fd84c15d0732b7ce/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372d626c75652e737667)

Use this skeleton application to quickly setup and start working on a new [Slim Framework 3](http://www.slimframework.com/) application incorporating the power of the [Symfony 2 Dependency Injection component](https://symfony.com/doc/2.8/service_container.html) or [Symfony 4 Dependency Injection component](http://symfony.com/doc/current/components/dependency_injection/introduction.html).

Symfony 2 is supported by PHP 5.6.. Symfony 4 is supported by PHP 7.1.

This demo also uses Sensio Labs' [Twig](http://twig.sensiolabs.org) template library, but you don't have to - use Smarty instead, or native PHP for your view scripts - it's up to you, - just configure the DIC definition files per your requirements. (Don't forget to add/remove dependencies in composer.json if you do.)

Also included is a minimal Controller (MVC) implementation, that allows you to seperate out the routing from the site application logic. Again, you don't need to use it if you don't want to.

This skeleton application was built for Composer. This makes setting up a new Slim Framework application quick and easy. You are not intended to include this as a composer requirement, but to create a new Composer app with it and move on.

This is a PHP5.6+ application

Install Composer
----------------

[](#install-composer)

Install \[Composer\] (). It is useful to symlink the composer.phar file into /usr/local/bin or your ~/bin directory, dependent on your circumstances e.g.

```
    cd ~/bin
    ln -s /path/to/composer.phar composer
    chmod u+x composer
```

Install the Application
-----------------------

[](#install-the-application)

After you install Composer, run this command from the directory below the one in which you want to install your new Slimdic application.

`    composer create-project the-matrix/slim-dic-example my-app-name 3.*`Replace my-app-name with the desired directory name for your new application. When the installer asks `Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]?`

then enter 'Y'.

(NB. If you want the Slim 2 + Symfony 2 version of this library, use 1.\* as the version number above.)

The rest of this section comes under the general heading of 'Teaching Grandma to Suck Eggs', but hey - someone out there is a newby!

You'll want to:

- Point your virtual host document root to your new application's `public/` directory.
- Ensure your web server has rights to your root directory. It needs to be able to read and write to the appropriate directories e.g.

```
    sudo chgrp -R apache my-app-name
    sudo chmod -R g+r my-app-name
    sudo chmod -R g+w my-app-name/spool
```

ensures that both you and the server can read and write. NB, check the user name that your server is running under, something like:

```
    ps aux | grep httpd
    # or
    ps aux | grep apache
```

normally does the trick.

Have a care for security. Dependent on your server, set the vhost to allow public access to the ./public directory only. The app needs to be able to see everything from one directory below, and no more.

Dependent on how you have set up your vhost, you may need to add an entry to the /etc/hosts file. I like to set each app I'm developing on it's own dns name so typically, I'll add something like

`127.0.0.1 my-app.localhost`to /etc/hosts. Obviously, the name needs to match your web server vhost name

Now assuming you've got all that, point your browser at the the vhost name and off you go - you should be seeing a nice page. Now browse to /logon and check out the cool demo logon. It doesn't matter if you get it wrong - the answer will be revealed.

So you did the demo. Now look at the code - it's all in there under the Site directory and in the public/index.php file.

And remember, once you've installed this demo template, you can change it without worrying that a `composer update` is going to override any code that you write. That will just update any packages you have defined in your composer.json file.

More reading
------------

[](#more-reading)

[The Site Directory](https://github.com/the-matrix/Slim-Dic-Example/blob/master/Site/readme.md)

[Using the Controller](https://github.com/the-matrix/Slim-Dic-Example/blob/master/Site/Controller/readme.md)

Find more
---------

[](#find-more)

Check out [ZF4 Packages](http://zf4.biz/packages?utm_source=github&utm_medium=web&utm_campaign=blinks&utm_content=slimdicexample) for more packages

History
-------

[](#history)

V1.0.0 Slim 2 + Symfony 2

V2.0.0 Slim 3 + Symfony 2

V2.0.1 Add link to packages

V2.0.2 bug fix from [Nigel Greenway](https://github.com/the-matrix/Slim-Dic-Example/pull/1)

V2.0.3 code clean. readme typos. bug fix from [Nigel Greenway](https://github.com/the-matrix/Slim-Dic-Example/pull/2)

V2.1.0 Update for PHP 7.1

V2.1.1 update composer - forced by packagist composer.json format change

V3.0.0 BC Break. Remove support for PHP &lt;5.6

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~161 days

Total

8

Last Release

2958d ago

Major Versions

1.0.0 → 2.0.02016-02-01

2.1.1 → 3.0.02018-04-03

PHP version history (3 changes)1.0.0PHP &gt;=5.5

2.1.0PHP &gt;=5.5,&lt;6|~7.1

3.0.0PHP ~5.6|~7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/198575568597b367c8b285de16d278018c8cf292c6c75c535270135c1eea0561?d=identicon)[chippyash](/maintainers/chippyash)

---

Top Contributors

[![chippyash](https://avatars.githubusercontent.com/u/983560?v=4)](https://github.com/chippyash "chippyash (25 commits)")

---

Tags

symfonydependency-injectionslimmvcmicroframework

### Embed Badge

![Health badge](/badges/the-matrix-slim-dic-example/health.svg)

```
[![Health](https://phpackages.com/badges/the-matrix-slim-dic-example/health.svg)](https://phpackages.com/packages/the-matrix-slim-dic-example)
```

PHPackages © 2026

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