PHPackages                             qckanemoto/twigged-swiftmessage-service-provider - 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. qckanemoto/twigged-swiftmessage-service-provider

Abandoned → [ttskch/twigged-swiftmessage-service-provider](/?search=ttskch%2Ftwigged-swiftmessage-service-provider)Library[Templating &amp; Views](/categories/templating)

qckanemoto/twigged-swiftmessage-service-provider
================================================

Twig templated Swift\_Message builder service provider for the Silex microframework.

2.1.0(9y ago)3481MITPHPPHP &gt;=5.3.3

Since Jun 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ttskch/TwiggedSwiftMessageServiceProvider)[ Packagist](https://packagist.org/packages/qckanemoto/twigged-swiftmessage-service-provider)[ Docs](https://github.com/ttskch/TwiggedSwiftMessageServiceProvider)[ RSS](/packages/qckanemoto-twigged-swiftmessage-service-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

TwiggedSwiftMessageServiceProvider
==================================

[](#twiggedswiftmessageserviceprovider)

[![Build Status](https://camo.githubusercontent.com/3530bbadbd3a72b1375dc58ea7490069eab54f55d4a727a2da793a40c4d95088/68747470733a2f2f7472617669732d63692e6f72672f7474736b63682f5477696767656453776966744d6573736167655365727669636550726f76696465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ttskch/TwiggedSwiftMessageServiceProvider)[![Latest Stable Version](https://camo.githubusercontent.com/8b4b661db1a67326018f54322cdd3b2bb84fb5349893b7c7a7ecabbb66174e87/68747470733a2f2f706f7365722e707567782e6f72672f7474736b63682f747769676765642d73776966746d6573736167652d736572766963652d70726f76696465722f762f737461626c652e737667)](https://packagist.org/packages/ttskch/twigged-swiftmessage-service-provider)[![Total Downloads](https://camo.githubusercontent.com/1fe648e929d4b83e4cab2a0a74537d20242d462a6adae2a00d7097b10bcb112e/68747470733a2f2f706f7365722e707567782e6f72672f7474736b63682f747769676765642d73776966746d6573736167652d736572766963652d70726f76696465722f646f776e6c6f6164732e737667)](https://packagist.org/packages/ttskch/twigged-swiftmessage-service-provider)

This is a service provider of [TwiggedSwiftMessageBuilder](https://github.com/ttskch/TwiggedSwiftMessageBuilder) for [Silex](http://silex.sensiolabs.org/).

Requirements
------------

[](#requirements)

- PHP 5.3+

Getting started
---------------

[](#getting-started)

First add this dependency into your `composer.json`:

```
{
    "require": {
        "ttskch/twigged-swiftmessage-service-provider": "~2.0"
    }
}
```

And enable this service provider in your application. Please notice that you must register both `TwigServiceProvider` and `SwiftmailerServiceProvider` on ahead.

```
$app->register(new TwigServiceProvider());
$app->register(new SwiftmailerServiceProvider());
$app->register(new \Ttskch\Silex\Provider\TwiggedSwiftMessageServiceProvider());
```

Then you can build `Swift_Message` object via twig template.

```
$message = $app['twigged_message']->buildMessage('email.txt.twig');
$message->setTo('hoge@example.com');
$app['mailer']->send($message);
```

See more detailed documentation [here](https://github.com/ttskch/TwiggedSwiftMessageBuilder/blob/master/README.md).

Use submitted form data in Twig template
----------------------------------------

[](#use-submitted-form-data-in-twig-template)

This service provider provides one additional feature to use submitted form data in Twig template easily. `$app['twigged_swiftmessage.form_handler']` allows you to extract data array from `Form` object.

Labels and values of each fields can be used as below:

- `{{ form.[field-name].label }}`
- `{{ form.[field-name].value }}`

For example:

```
{# email.txt.twig #}

{% block from %}{{ form.email.value }}{% endblock %}
{% block from_name %}{{ form.name.value }}{% endblock %}
{% block to %}contact@example.com{% endblock %}

{% block subject %}[Contact] {{ form.summary.value }}{% endblock %}

{% block body %}
{% for item in form %}
----------------------------------------------------------------------
{{ item.label }}: {{ item.value }}
{% endfor %}
----------------------------------------------------------------------
{% endblock %}
```

```
// in your controller.

$form->handleRequest($request);
if ($form->isValid()) {
    $array = $app['twigged_message.form_handler']->getDataArray($form);
    $message = $app['twigged_message']->buildMessage('email.txt.twig', array('form' => $array));
    $app['mailer']->send($message);
}
```

Offcourse you also can access to your custom field type as below:

- `{{ form.[parent-field].[child-field].label }}`
- `{{ form.[parent-field].[child-field].value }}`

Enjoy!
------

[](#enjoy)

See more detailed documentation [here](https://github.com/ttskch/TwiggedSwiftMessageBuilder/blob/master/README.md).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3518d ago

Major Versions

1.0.0 → 2.0.02016-09-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4360663?v=4)[Takashi Kanemoto](/maintainers/ttskch)[@ttskch](https://github.com/ttskch)

---

Top Contributors

[![ttskch](https://avatars.githubusercontent.com/u/4360663?v=4)](https://github.com/ttskch "ttskch (1 commits)")

---

Tags

twigsilexSwift\_MessageSwift\_Mailer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/qckanemoto-twigged-swiftmessage-service-provider/health.svg)

```
[![Health](https://phpackages.com/badges/qckanemoto-twigged-swiftmessage-service-provider/health.svg)](https://phpackages.com/packages/qckanemoto-twigged-swiftmessage-service-provider)
```

###  Alternatives

[boekkooi/jquery-validation-bundle

Jquery form validation bundle for symfony 2

2773.9k1](/packages/boekkooi-jquery-validation-bundle)[mustache/silex-provider

A Mustache service provider for Silex.

1462.4k1](/packages/mustache-silex-provider)[entea/silex-twig-simple-asset-extension

Simple twig asset function for Silex

166.1k2](/packages/entea-silex-twig-simple-asset-extension)

PHPackages © 2026

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