PHPackages                             vierwd/symfony-smarty - 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. vierwd/symfony-smarty

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

vierwd/symfony-smarty
=====================

Symfony Smarty Component

219PHP

Since Feb 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/4wdmedia/symfony_smarty)[ Packagist](https://packagist.org/packages/vierwd/symfony-smarty)[ RSS](/packages/vierwd-symfony-smarty/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony Smarty Extension
========================

[](#symfony-smarty-extension)

> Use [Smarty](http://www.smarty.net/) in your templates.

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

[](#installation)

Install using [composer](https://getcomposer.org/):

```
composer require 'vierwd/symfony-smarty'

```

### Usage in controllers

[](#usage-in-controllers)

To use smarty templates for your controller just extend the `Vierwd\Symfony\Smarty\Controller\SmartyController`. You can then use `$this->render('error/error.tpl')` to render a Smarty template.

#### Example

[](#example)

```
// src/Controller/IndexController.php
namespace App\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

use Vierwd\Symfony\Smarty\Controller\SmartyController;

class IndexController extends SmartyController {

	/**
	 * @Route("/", name="index")
	 */
	public function index(Request $request): Response {
		return $this->render('index/index.tpl', ['message' => 'Hello from Smarty']);
	}
}
```

```
{* templates/index/index.tpl *}

{$message}
```

### Pre-defined variables

[](#pre-defined-variables)

There are some variables, that are always available to your templates:

Variable NameContentsapp`Symfony\Bridge\Twig\AppVariable`tagRenderer`Symfony\WebpackEncoreBundle\Asset\TagRenderer`imageServiceAn image service which can be used to scale images using imagemagickauthChecker`AuthorizationCheckerInterface`### Pre-defined smarty functions, blocks and modifiers

[](#pre-defined-smarty-functions-blocks-and-modifiers)

- csrf\_token
- integer
- url
- path
- svg
- twig
- widget
- inlineCSS

### Power-Block: twig

[](#power-block-twig)

If you still need some twig logic, you can embed twig template code within your Smarty templates:

#### Twig in Smarty template

[](#twig-in-smarty-template)

```
{$message}
{twig}
	{literal}
		{{ form_start(createForm) }}
		{{ form_rest(createForm) }}
	{/literal}
{/twig}
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 69% 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/31570fd9995c0f4bd2046957d8e043e8160b8acbfbb53ce560059f73fed7e4e6?d=identicon)[rvock](/maintainers/rvock)

---

Top Contributors

[![rvock](https://avatars.githubusercontent.com/u/209159?v=4)](https://github.com/rvock "rvock (29 commits)")[![spetters](https://avatars.githubusercontent.com/u/800522?v=4)](https://github.com/spetters "spetters (13 commits)")

### Embed Badge

![Health badge](/badges/vierwd-symfony-smarty/health.svg)

```
[![Health](https://phpackages.com/badges/vierwd-symfony-smarty/health.svg)](https://phpackages.com/packages/vierwd-symfony-smarty)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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