PHPackages                             solution-web/marty - 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. solution-web/marty

Abandoned → [bertptrs/marty](/?search=bertptrs%2Fmarty)Library[Templating &amp; Views](/categories/templating)

solution-web/marty
==================

Smarty view renderer for the Mako framework

v6.1.0(5y ago)15374MITPHPPHP ^7.2

Since Nov 18Pushed 3y ago3 watchersCompare

[ Source](https://github.com/SolutionWeb/marty)[ Packagist](https://packagist.org/packages/solution-web/marty)[ Docs](http://bertptrs.nl/marty/)[ RSS](/packages/solution-web-marty/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (6)Versions (25)Used By (0)

Marty
=====

[](#marty)

[![Continuous Integration](https://github.com/bertptrs/marty/actions/workflows/ci.yml/badge.svg)](https://github.com/bertptrs/marty/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/1fc3074a6eb18b31da91a5dd3e85dcefec5778200d05664cdfc3ec6b343abd2f/68747470733a2f2f706f7365722e707567782e6f72672f62657274707472732f6d617274792f762f737461626c65)](https://packagist.org/packages/bertptrs/marty)[![Total Downloads](https://camo.githubusercontent.com/77c9d9a89f65ab2ec68378ccafc2de0b096e9a364746386d0c2e3e38e6c4683e/68747470733a2f2f706f7365722e707567782e6f72672f62657274707472732f6d617274792f646f776e6c6f616473)](https://packagist.org/packages/bertptrs/marty)[![License](https://camo.githubusercontent.com/8dcca33256155672b507b4b27552e027ad4187353fcb0d00d1e260fd1ee632d5/68747470733a2f2f706f7365722e707567782e6f72672f62657274707472732f6d617274792f6c6963656e7365)](https://packagist.org/packages/bertptrs/marty)

Marty is a simple Smarty view renderer for the Mako framework.

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

[](#requirements)

Marty has been tested on all current Mako versions. Any other version *may* work, but has not been tested. Unit tests are run against PHP 7.0 and up. Smarty 3 or 4 is required, but will be pulled in as part of the installation.

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

[](#installation)

Marty can be added to your Mako project using composer! Just add it to your requirements

```
{
	/* Stuff */
	require: {
		/* Your other requirements */
		"bertptrs/marty": "*"
	}
	/* The rest of your composer.json*/
}
```

Usage
-----

[](#usage)

Once installed, you will need to add it to your packages list. You do this by adding it to the "Web" packages. This is located in the file `app/config/application.php`.

```

```

This enables the Smarty View renderer for every view with the ".tpl" file extension.

### Configuration

[](#configuration)

Configuration can be done by changing the `marty::smarty` configuration. Just refer to the [Mako documentation on package configuration](http://makoframework.com/docs/3.6/getting-started:configuration#cascading_configuration)for details.

The configuration properties are as follows:

Configuration propertyTypeDescriptionDefaultsmarty.templateDirstringThe location to find smarty templates.Your `app/views` directory.smarty.compileDirstringThe location to store compiled templates.A new directory `smarty` in your `app/storage` directory.smarty.pluginDirsstring\[\]A list of directories to search for smarty plugins.An empty array.### Plugins

[](#plugins)

Marty supports the plugin structure offered by Smarty, and extends it to use the dependency injector offered by the Mako framework.

Plugin dirs can be added to the config. The structure for plugins can be found in the [Smarty Documentation](http://www.smarty.net/docs/en/). Due to the fact that Mako resolves parameters by name, Smarty plugin parameters should have their names as specified in the documentation. This means that the parameters should be named as follows:

- Template functions:
    - parameters should be named `$params`
    - The smarty template should be named `$template`
- Modifiers:
    - The input data should be named `$value`
    - Any other values will be stored in array `$params` in order.
- Block functions:
    - Call parameters should be named `$params`
    - The block content should be named `$content`
    - The template reference should be named `$template`
    - The repetition flag should be named `$repeat`.
- Compiler functions:
    - Call parameters should be named `$params`
    - The Smarty reference should be named `$smarty`

As an example, we can build a small plugin that uses the I18n module of the framework.

```
function smarty_modifier_i18n($value, mako\i18n\I18n $i18n) {
    return $i18n->get($value);
}
```

Then, we can use your plugin like this:

```
Lets show {'some.translated.text'|i18n}.
```

Contributing
------------

[](#contributing)

If there are any features in Smarty that cannot (easily) be used in the current package, or if there are Mako features that are hard to bind to Smarty, feel free to file an issue or a pull request.

Code style and such are ran using GrumPHP. Make sure that your files are in accordance to those rules.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 96.8% 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 ~108 days

Recently: every ~190 days

Total

24

Last Release

2067d ago

Major Versions

v0.4.0 → v1.0.02014-08-11

v1.0.0 → v4.1.02014-12-03

v4.6.4 → v5.0.02016-10-31

v5.2.3 → v6.02019-04-09

PHP version history (3 changes)v0.1PHP &gt;=5.3.1

v5.2.3PHP ^7

v6.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/ffd7b003b8e431b6f283d73633db9a2a0a0f249da489a4c7a47e70410b9ace19?d=identicon)[solution-web](/maintainers/solution-web)

---

Top Contributors

[![bertptrs](https://avatars.githubusercontent.com/u/861864?v=4)](https://github.com/bertptrs "bertptrs (122 commits)")[![bors[bot]](https://avatars.githubusercontent.com/in/1847?v=4)](https://github.com/bors[bot] "bors[bot] (3 commits)")[![GalacticCheese](https://avatars.githubusercontent.com/u/34104901?v=4)](https://github.com/GalacticCheese "GalacticCheese (1 commits)")

---

Tags

mako-frameworksmartymakotemplatesmarty

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/solution-web-marty/health.svg)

```
[![Health](https://phpackages.com/badges/solution-web-marty/health.svg)](https://phpackages.com/packages/solution-web-marty)
```

###  Alternatives

[ytake/laravel-smarty

Smarty template engine for Laravel and Lumen

87401.6k](/packages/ytake-laravel-smarty)[text/template

Simple and secure string-template-engine (Twig-like syntax) with nested if/elseif/else, loops, filters. Simple OOP api: Just one class doing the job (2-lines of code). Fast and secure: No code-generation, no eval'ed() code. Extensible by callbacks. Fully tested. Rich examples included.

38201.1k10](/packages/text-template)[noiselabs/smarty-bundle

This Symfony bundle provides integration for the Smarty3 template engine.

53194.4k1](/packages/noiselabs-smarty-bundle)[monotek/minitpl

Miniature fully featured PHP template engine

125.5k1](/packages/monotek-minitpl)

PHPackages © 2026

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