PHPackages                             alphalemon/theme-engine-bundle - 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. [Templating &amp; Views](/categories/templating)
4. /
5. alphalemon/theme-engine-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

alphalemon/theme-engine-bundle
==============================

ThemeEngineBundle adds theming feature to any Symfony2 application, adding themes packed as standard Symfony2 Bundles

1.2.0(14y ago)71.9k1[1 issues](https://github.com/alphalemon/ThemeEngineBundle/issues)1MITPHPCI failing

Since Jan 28Pushed 12y ago1 watchersCompare

[ Source](https://github.com/alphalemon/ThemeEngineBundle)[ Packagist](https://packagist.org/packages/alphalemon/theme-engine-bundle)[ Docs](http://alphalemon.com)[ RSS](/packages/alphalemon-theme-engine-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (6)Versions (5)Used By (1)

ThemeEngineBundle
=================

[](#themeenginebundle)

ThemeEngineBundle is build with the pourpose to add theming feature to any Symfony2 application, solving one of the most difficult problem related to templating: the preservation of contents when a graphic theme is changed. ThemeEngineBundle tries to solve this problem introducing slots. A slot is simple a placeholder on a twig template, identified by a name, and implemented as a twig function. Follows an example:

```
{{ renderSlot('logo') }}

```

This function tells twig to render the contents identified by the slot called "logo", nothing more. The next step is quite easy: the contents retained by the "logo" slot are rendered on each template where the placeholder is called.

The themes, managed by the ThemeEngineBundle, are nothing more than standard Symfony2 Bundles, so each theme has its own templates, configurations and assets packed togheter into a well defined known structure.

[![Build Status](https://camo.githubusercontent.com/4346f290d87ccf4b8de1c0734acb168347dc9a5f8589b38c078cc1f3177a0e23/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f616c7068616c656d6f6e2f5468656d65456e67696e6542756e646c652e706e67)](http://travis-ci.org/alphalemon/ThemeEngineBundle)

Install the ThemeEngineBundle
-----------------------------

[](#install-the-themeenginebundle)

The ThemeEngine depends on several bundles and packages:

- PageTreeBundle
- AlValumUploaderBundle
- Propel ORM
- Propel Bundle

Get the ThemeEngineBundle
-------------------------

[](#get-the-themeenginebundle)

Clone this bundle in the vendor/bundles/AlphaLemon directory:

```
git clone git://github.com/alphalemon/ThemeEngineBundle.git vendor/bundles/AlphaLemon/ThemeEngineBundle

```

Configure the ThemeEngineBundle
-------------------------------

[](#configure-the-themeenginebundle)

Open the AppKernel configuration file and add the bundle to the registerBundles() method:

```
public function registerBundles()
{
    $bundles = array(
        ...
        new AlphaLemon\ThemeEngineBundle\AlphaLemonThemeEngineBundle(),
    )
}

```

Register the ThemeEngineBundle namespaces in `app/autoload.php`:

```
$loader->registerNamespaces(array(
    ...
    'AlphaLemon'                     => __DIR__.'/../vendor/bundles',
    'Themes'                         => __DIR__.'/../vendor/bundles/AlphaLemon/ThemeEngineBundle',
));

```

Import the routing configuration into the routing.yml file:

```
_alphaLemonThemeEngineBundle:
    resource: "@AlphaLemonThemeEngineBundle/Resources/config/routing.yml"

```

To complete the bundle configuration you must install assets as follows:

```
app/console assets:install web

```

Configure propel
----------------

[](#configure-propel)

ThemeEngineBundle needs a database to manage the themes and uses Propel as predefined ORM. To propely setup Propel with Symfony2, foolow the excellent setup procedure provide by the [PropelBundle](https://github.com/propelorm/PropelBundle/blob/master/Resources/doc/README.markdown) bundle. When the ORM is properly configured, run the following commands:

```
app/console propel:database:create
app/console propel:build
app/console propel:insert-sql --for

```

Themes autoloading
------------------

[](#themes-autoloading)

The ThemeEngineBundle provides a complete web interface to manage themes. As explained above, themes are nothing more than symfony2 bundles and, as each symfony2 bundle, they must be loaded in the registerBundles() method. Sometimes it could be a pain to manually add each bundle to AppKernel class, so if you wish to automate this operation, the bundle provides an autoloader class that loads all the bundles placed inside a given directory:

```
app/AppKernel.php

use AlphaLemon\ThemeEngineBundle\Core\Autoloader\ThemesAutoloader;

public function registerBundles()
{
    $bundles = array(
        new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
        ...
    );

    $themes = new ThemesAutoloader();
    $bundles = array_merge($bundles, $themes->getBundles());
}

```

Using this feature or not, is totally up to you. If you prefer to manually add your themes to the AppKernel, you may do it as usual.

Tutorial
--------

[](#tutorial)

A detailed tutorial on usage of ThemeEngineBundle can be found under the Resources/docs folder of the bundle itself.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~179 days

Total

4

Last Release

4730d ago

Major Versions

1.2.0 → 2.3.x-dev2013-07-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/86c46bc59b7abe8c18a0bb08713b28f2a4e10c729f5c4c247361860f421bdf46?d=identicon)[alphalemon](/maintainers/alphalemon)

---

Top Contributors

[![alphalemon](https://avatars.githubusercontent.com/u/1242258?v=4)](https://github.com/alphalemon "alphalemon (137 commits)")[![Seldaek](https://avatars.githubusercontent.com/u/183678?v=4)](https://github.com/Seldaek "Seldaek (2 commits)")

---

Tags

cmsthemethemes

### Embed Badge

![Health badge](/badges/alphalemon-theme-engine-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/alphalemon-theme-engine-bundle/health.svg)](https://phpackages.com/packages/alphalemon-theme-engine-bundle)
```

PHPackages © 2026

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