PHPackages                             a3gz/chubby - 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. a3gz/chubby

ActiveProject[Framework](/categories/framework)

a3gz/chubby
===========

An application template for Slim 3

3.0.0(4y ago)1102MITPHPCI failing

Since Jan 5Pushed 4y agoCompare

[ Source](https://github.com/a3gz/chubby)[ Packagist](https://packagist.org/packages/a3gz/chubby)[ RSS](/packages/a3gz-chubby/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (12)Used By (0)

Chubby
======

[](#chubby)

Adding some fat to [Slim Framework](https://github.com/slimphp/Slim).

Chubby provides a working Slim application template around which additional fat is added in two ways: (1) useful classes under the `fat` directory and (2) as modules.

The first of these modules is [Chubby View](https://github.com/a3gz/chubby-view), a renderer that proposes a very convenient way of organizing code.

Install via Composer
--------------------

[](#install-via-composer)

Go to the directory where you want the new application to sit, then create the project:

```
composer create-project a3gz/chubby -s dev

```

This will create a new project called `chubby`.

Once the project has been created you can safely delete the `chubby/composer.json` file and the `chubby/vendor` directory. **Don't delete the file `chubby/private/composer.json` thought, this one is wher you add your dependencies**.

Chubby needs all required dependencies to sit on the `private` directory:

```
> cd chubby/private
> composer install

```

Finally go to your browser and request:

```
.../chubby/hello/world

```

It's very unlikely that you'll want your application to be called `chubby`, so you may want to rename that directory.

It is also possible to do this when you create the project:

```
composer create-project a3gz/chubby my-app -s dev

```

Now your application is in `./my-app`.

### Running with Docker Compose

[](#running-with-docker-compose)

```
docker-compose up [-d]

```

The provided `docker-compose.yml` maps to the host's 9999 port so you should be able to see the site in the following local address:

```
http://localhost:9999

```

Console request
---------------

[](#console-request)

```
php console.php path/to/resource

```

Why Chubby at all?
------------------

[](#why-chubby-at-all)

Chubby is a working application template that offers one possible way to organize a Slim application.

Around that idea Chubby sets the foundations to split the application files in a way that the code can be placed outside the `public_html` directory, among other things.

### Configuration

[](#configuration)

Chubby assumes the existence of a `private/app/config` directory containing two directories: `config/container` and `config/settings`. Under `config/container` there must extist at least one file called `main.php`. This file should return an associateive array with settings that will be injected in the container.

Optionally we can inject additional dependencies by adding more files inside the `config/container` directory. Each file must return one dependency. Take the provided `logger.php` for instance:

```
return function ($c) {
  $time = time();
  $year = date('Y', $time);
  $month = date('m', $time);
  $day = date('d', $time);
  $hour = date('H', $time);
  $baseDir = \Fat\Helpers\Path::makePrivatePath('/logs'
    . '/' . $year
    . '/' . $month
    . '/' . $day
  );
  if (!is_dir($baseDir)) {
    mkdir($baseDir, 0777, true);
  }
  $fileName = "{$year}m{$month}d{$day}h{$hour}.log";
  $logFileName = "{$baseDir}/{$fileName}";

  $logger = new \Monolog\Logger($appName);
  $file_handler = new \Monolog\Handler\StreamHandler($logFileName);
  $logger->pushHandler($file_handler);
  return $logger;
};

```

Chubby will inject the dependency in the container under the same name as the file, in this case: `logger`: `$container['logger']`.

Slim 4
------

[](#slim-4)

Chubby version `^3` depends on Slim `4.3.0` to keep PHP requirement down to `PHP 7.1`. If a higher version of PHP is available, changing Slim dependency version to `^4` should work since we are still in the same major version... but I haven't tried this yet.

This version is more opinionated that Chubby `^1` because some of the things that were taken care of by Slim are now under our control. The new directory `src/fat` contains classes that help with:

- Initiating the `App`.
- Adding an error handler.
- Solving `HttpNotFoundException` in a way that makes it easy to customize by simply editing `config.php`.
- Bringing back Slim3's `Environment::mock()` to make console requests possible by mocking an HTTP request.

Hooks
-----

[](#hooks)

Version 3 includes hooks and plugins support. Plugins are expected to extist under `private/app/plugins`. Each plugin must have a file called the same as the plugin's directory. This file must include a header section with at least one entry: `type` which value must be `Plugin` for the plugins loader to recognize it as such. Check the demo plugin to see how it works.

### Built-in hooks

[](#built-in-hooks)

NameDescriptionchubby\_fallback\_themeThe name of the fallback theme. If this filter isn't implemented, the falback theme name is `default`.chubby\_themeName of the applied theme. Fallbacks to the fallback theme.Themes
------

[](#themes)

Version 3 includes themes support. Themes can be customized in two levels: **styles** and **views**. We can create different stylesheets to change a Web site theme and use the default views. A step further would be to also create custom views for each theme.

In most situations creating stylesheets would be enough but if we also want to change the layout of a view then we need to create specific views for each theme. Note that we only need to create theme specific views for the views we want to override. If we don't override a view, the default one is automatically used.

Check the demo to see hot this works.

Contact the author
------------------

[](#contact-the-author)

I would welcome comments, suggestions and brainstorming-like ideas.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity68

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 ~170 days

Recently: every ~257 days

Total

8

Last Release

1540d ago

Major Versions

v0.4.0 → v2.0.02020-07-25

v1.0.0 → 3.0.02022-04-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/71a4c7affb109a5e4a15bdeaf55b70e268d59b0101c8ebacf899cb8e237c4950?d=identicon)[a3gz](/maintainers/a3gz)

---

Top Contributors

[![a3gz](https://avatars.githubusercontent.com/u/84980?v=4)](https://github.com/a3gz "a3gz (152 commits)")

---

Tags

phpframeworkslimapplication template

### Embed Badge

![Health badge](/badges/a3gz-chubby/health.svg)

```
[![Health](https://phpackages.com/badges/a3gz-chubby/health.svg)](https://phpackages.com/packages/a3gz-chubby)
```

###  Alternatives

[slim/php-view

Render PHP view scripts into a PSR-7 Response object.

2749.8M101](/packages/slim-php-view)[davidepastore/slim-config

A slim middleware to read configuration from different files based on hassankhan/config

339.0k1](/packages/davidepastore-slim-config)[phphleb/webrotor

Asynchronous PHP web server for shared hosting

641.5k1](/packages/phphleb-webrotor)[patricksavalle/slim-rest-api

Production-grade REST-API App-class for PHP SLIM, in production on https://zaplog.pro (https://api.zaplog.pro/v1)

101.4k](/packages/patricksavalle-slim-rest-api)

PHPackages © 2026

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