PHPackages                             ajur-media/template - 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. ajur-media/template

Abandoned → [karelwintersky/arris.template](/?search=karelwintersky%2Farris.template)ArchivedLibrary[Templating &amp; Views](/categories/templating)

ajur-media/template
===================

Template class for AJUR Media projects, based on Smarty

1.2.0(2y ago)0152MITPHPPHP ^7.4 || 8.\*

Since Jan 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ajur-media/template)[ Packagist](https://packagist.org/packages/ajur-media/template)[ RSS](/packages/ajur-media-template/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

AJUR Templater
==============

[](#ajur-templater)

### How to use?

[](#how-to-use)

```
require_once __DIR__ . '/vendor/autoload.php';

$SMARTY = new Smarty();
$SMARTY->setTemplateDir( __DIR__ );
$SMARTY->setCompileDir( __DIR__ . '/cache/');
$SMARTY->setForceCompile(true);

// Global + inner templates

$global = new \AJUR\Template($SMARTY, $_REQUEST);
$global->setTemplate('1.tpl');

$inner = new \AJUR\Template($SMARTY);
$inner->setTemplate("2.tpl");
$inner->assign('value_1', 'FOO');
$inner->assign('value_2', 'BAR');

$global->assign("content", $inner->render());

echo $global->render();

// Global + include secondary template:

$global = new \AJUR\Template($SMARTY);
$global->setTemplate('0.tpl');
$global->assign("file", "2.tpl");
$global->assign('value_1', 'FOO');
$global->assign('value_2', 'BAR');

echo $global->render();

// JSON

$global = new \AJUR\Template($SMARTY);
$global->assign("file", "2.tpl");
$global->assign('value_1', 'FOO');
$global->assign('value_2', 'BAR');

// or use helper

$global->assignJSON([
    'file'      =>  '2.tpl',
    'value_1'   =>  'FOO',
    'value_2'   =>  'BAR',
]);

$global->setRenderType(\AJUR\Template::CONTENT_TYPE_JSON);

echo $global->render();
```

### Плагины шаблонизатора

[](#плагины-шаблонизатора)

Для корректной работы плагина нужен параметр `opcache.save_comments = 1` в php.ini

Передача параметров в (регистрируемые) плагины:

#### modifier

[](#modifier)

Есть два способа и зависят они от способа регистрации функции:

А) через перечисление аргументов (причем опущенные аргументы принимают значение по умолчанию)

```
{$size|size_format:decimals:separator:separator}
```

Тогда функция должна быть определена так:

```
public static function size_format(int $size, int $decimals = 0, string $decimal_separator = '.', string $thousands_separator = ','):string;
```

Б) через массив аргументов

```
{$size|size_format:[3,',','-']}
```

Тогда функция должна быть определена иначе:

```
public static function sf(int $size, array $params):string
{
    $decimals = $params['decimals'] ?? 3;
    $decimal_separator = $params['decimal_separator'] ?? '.';
    $thousands_separator = $params['thousands_separator'] ?? ',';
    // ...
}
```

#### function

[](#function)

Используется так:

```
{sum a=11 b=14}
```

Метод должен быть определен ТОЛЬКО так:

```
function sum($params)
{
    return ($params['a'] ?? 0) + ($params['b'] ?? 0);
}
```

---

@todo:

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Recently: every ~71 days

Total

6

Last Release

878d ago

Major Versions

0.99.0 → 1.0.02023-04-27

PHP version history (2 changes)0.99.0PHP ^7.4

1.1.5PHP ^7.4 || 8.\*

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2164874?v=4)[Karel Wintersky](/maintainers/KarelWintersky)[@KarelWintersky](https://github.com/KarelWintersky)

---

Top Contributors

[![KarelWintersky](https://avatars.githubusercontent.com/u/2164874?v=4)](https://github.com/KarelWintersky "KarelWintersky (10 commits)")

###  Code Quality

Static AnalysisRector

### Embed Badge

![Health badge](/badges/ajur-media-template/health.svg)

```
[![Health](https://phpackages.com/badges/ajur-media-template/health.svg)](https://phpackages.com/packages/ajur-media-template)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k373.5M3.3k](/packages/symfony-cache)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k51](/packages/ecotone-ecotone)

PHPackages © 2026

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