PHPackages                             axis/axis-hybrid-templating-plugin - 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. axis/axis-hybrid-templating-plugin

AbandonedArchivedSymfony1-plugin[Templating &amp; Views](/categories/templating)

axis/axis-hybrid-templating-plugin
==================================

symfony 1.x plugin that enables to use multiple templating engines with symfony.

1202PHP

Since Oct 6Pushed 11y ago1 watchersCompare

[ Source](https://github.com/e1himself/axis-hybrid-templating-plugin)[ Packagist](https://packagist.org/packages/axis/axis-hybrid-templating-plugin)[ RSS](/packages/axis-axis-hybrid-templating-plugin/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

AxisHybridTemplatingPlugin
==========================

[](#axishybridtemplatingplugin)

This plugin allows you to use different templating engines with symfony 1.x simultanously with fallback in order of priority.

For example you can specify PHP template for applicaiton layout decorator and Twig template for action view.

Installation
------------

[](#installation)

Use [Composer](http://getcomposer.org/). Just add this dependency to your `composer.json`:

```
  "require": {
    "axis/axis-hybrid-templating-plugin": "dev-master"
  }
```

Configuration
-------------

[](#configuration)

To enable Hybrid Templating in your project you should configure symfony to use Hybrid views for layouts and partials using `module.yml` config file:

```
all:
  view_class: \Axis\S1\HybridTemplating\View\Hybrid   # means HybridView class
  partial_view_class: \Axis\S1\HybridTemplating\View\Hybrid   # means HybridPartialView class
```

That's all.

By default the only enabled templating engine is PHP. You can enable other templating engines following instructions beyond.

### Templating engines priorities

[](#templating-engines-priorities)

Sometimes you'll have situations when there is more than one template for a given partial or controller view available in your project. So there is a questin what will be loaded first. To control the templating engines priority you can use `priority` option of Hybrid Templating Loader in your project's `factories.yml` file.

```
  hybrid_templating.loader:
    parameters:
      priority: [twig, php] # these are extensions of supported templating engines in order of priority
```

or

```
  hybrid_templating.loader:
    parameters:
      priority:
        twig: 100 # highest priority > will be checked first
        php:  1   # lowest priority > will be checked last
```

This configuration leads to unambiguous template loader order controlled by you. By default templating engines are checked in order they were defined in `factories.yml` file.

---

*Note*: This way of `factories.yml` configuration is supported by [AxisServiceContainerPlugin](https://github.com/e1himself/axis-service-container-plugin)

### Twig

[](#twig)

To use [Twig](http://twig.sensiolabs.org/) templating engine you should include `axis/axis-twig-plugin` into your project. Just add dependency to it in your `composer.json`:

```
  "require": {
    "axis/axis-twig-plugin": "dev-master"
  }
```

Next you should configure Twig engine for Hybrid Templating. Add this to your project's `factories.yml`:

```
all:
  hybrid_templating.engine.twig:
    class: \Axis\S1\HybridTemplating\Engine\TwigTemplatingEngine
    parameters:
      twig: context://twig
    tag: hybrid_templating.engine
```

Usage examples
--------------

[](#usage-examples)

Imagine you have an application:

```
apps/
  - hybrid/
    - config/
      - app.yml
      - module.yml
      - routing.yml
      - settings.yml
    - modules/
      - homepage/
        - actions/
          - actions.class.php
        - templates/
          - _partial.twig
          - indexSucces.php
    - templates/
      - layout.twig

```

As you have noticed your controller view is using PHP templating while layout and partial are Twig templates. This will work transparently switching between templating engines contexts passing specified variables between templates.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.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/6d24c797f078b59b84f555eb4ac8b468424e3b29740180a4abb5ca5bc51e27f5?d=identicon)[7heaven](/maintainers/7heaven)

---

Top Contributors

[![e1himself](https://avatars.githubusercontent.com/u/370680?v=4)](https://github.com/e1himself "e1himself (18 commits)")[![IllyaSvergun](https://avatars.githubusercontent.com/u/6874801?v=4)](https://github.com/IllyaSvergun "IllyaSvergun (1 commits)")

### Embed Badge

![Health badge](/badges/axis-axis-hybrid-templating-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/axis-axis-hybrid-templating-plugin/health.svg)](https://phpackages.com/packages/axis-axis-hybrid-templating-plugin)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3841.2M](/packages/limenius-react-bundle)[pdewit/nova-external-url

An external URL Laravel Nova field.

30383.2k](/packages/pdewit-nova-external-url)[wbrowar/guide

A CMS Guide for Craft CMS.

6154.7k1](/packages/wbrowar-guide)[localgovdrupal/localgov_base

The base theme for LocalGov Drupal websites.

13126.9k5](/packages/localgovdrupal-localgov-base)

PHPackages © 2026

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