PHPackages                             shadowfax/zf-themes - 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. shadowfax/zf-themes

ActiveLibrary

shadowfax/zf-themes
===================

Theme system for ZF2

4111PHP

Since Sep 5Pushed 12y ago2 watchersCompare

[ Source](https://github.com/shadowfax/zf-themes)[ Packagist](https://packagist.org/packages/shadowfax/zf-themes)[ RSS](/packages/shadowfax-zf-themes/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

ZF-Themes
=========

[](#zf-themes)

Zend Framework 2 (ZF2) theme manager

Add the following line to composer.json of your application

```
"require": {
    "shadowfax/zf-themes": "dev-master"
}

```

In the index.php change

```
Zend\Mvc\Application::init(require 'config/application.config.php')->run();

```

with

```
Themes\Mvc\Application::init(require 'config/application.config.php')->run();

```

This will load the `ThemeManager` service.

When creating a new module simply implement `Themes\ModuleManager\Feature\ThemeProviderInterface`

```
...

use Themes\ModuleManager\Feature\ThemeProviderInterface;

...

class Module implements ThemeProviderInterface
{

    ...

    public function getDir()
    {
    	return __DIR__;
    }

    public function getNamespace()
    {
    	return __NAMESPACE__;
    }

    ...

}

```

The themes should be in a subfolder called `themes` inside the module directory. There should be, atleast, a theme called `default`.

Example tree:

- themes
    - default
    - my\_new\_theme

The layout file `layout.phtml` should be in the root of the theme, all the rest works just like Zend Framework's `view` folder.

Assets (CSS, JS, Images,...) can be stored in the `assets` folder under the theme. Here is an example entry for the default module.

- default
    - assets
        - css
            - layout.css
            - bootstrap.css
        - js
            - jquery.js
    - application
        - index
            - index.phtml
    - layout.phtml

The module makes a route named `assets`. The url to assets is

```
/assets/:modules/*

```

Where `*` is the relative path to the actual asset.

Making a port of a Zend Framework 2 application to a theme based applications should be a breeze as you only have to change the name of `view` forlder to `default`, move it into a folder named `themes` and move the layout file and you are ready.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/307bfc1dbc923e6cc783f313d578e13142a7a373c50726daf6d3adff38ced853?d=identicon)[shadowfax](/maintainers/shadowfax)

---

Top Contributors

[![shadowfax](https://avatars.githubusercontent.com/u/735316?v=4)](https://github.com/shadowfax "shadowfax (7 commits)")

### Embed Badge

![Health badge](/badges/shadowfax-zf-themes/health.svg)

```
[![Health](https://phpackages.com/badges/shadowfax-zf-themes/health.svg)](https://phpackages.com/packages/shadowfax-zf-themes)
```

PHPackages © 2026

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