PHPackages                             webchemistry/component-macro - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. webchemistry/component-macro

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webchemistry/component-macro
============================

2.0(9y ago)15.4k1PHPPHP &gt;= 7.1

Since Aug 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/WebChemistry/component-macro)[ Packagist](https://packagist.org/packages/webchemistry/component-macro)[ RSS](/packages/webchemistry-component-macro/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

Component-Macro
===============

[](#component-macro)

Replacement of include, import from nette with more beautiful and shorter version.

[![Build Status](https://camo.githubusercontent.com/ed983c3c4552a989a3dc7b05b9c03b299da281baf2e9bf98748a817436d1b842/68747470733a2f2f7472617669732d63692e6f72672f5765624368656d69737472792f636f6d706f6e656e742d6d6163726f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/WebChemistry/component-macro)

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

[](#installation)

```
	WebChemistry\Macros\ComponentMacro::install($latte->getCompiler(), __DIR__ . '/component-dir');
```

Usage single file
-----------------

[](#usage-single-file)

```

```

~ Same in nette:

```
	{include __DIR__ . '/component-dir/template.latte'}
```

Renders content from component-dir/template.latte

Usage single file, multiple blocks
----------------------------------

[](#usage-single-file-multiple-blocks)

```

```

Same in nette:

```
{import __DIR__ . '/component-dir/template.latte'}

{include #first}
{include #second key => value}
```

template.latte

```
{define first}
    ...
{/define}

{define second}
    {$key}
    ...
{/define}
```

Usage file from other directory
-------------------------------

[](#usage-file-from-other-directory)

```

```

Same in nette:

```
{include __DIR__ . '/component-dir/template/first.latte'}
```

template/first.latte:

```
...
```

Custom parameters
-----------------

[](#custom-parameters)

```

```

Same in nette:

```
	{include __DIR__ . '/component-dir/template.latte' foo => bar}
```

template.latte

```
	{$foo}
```

Content
-------

[](#content)

```

		Content with dynamic parameter or with macros

```

Same in nette:

```
{capture $foo}
	Content with dynamic parameter or with macros {include __DIR__ . '/component-dir/template.latte'}
{/capture}
{include __DIR__ . '/component-dir/template.latte' _content => $foo}
```

template.latte

```
{!$_content}
```

Modifiers
---------

[](#modifiers)

```

    		Content with dynamic parameter or with macros

```

Same in nette:

```
{include __DIR__ . '/component-dir/template.latte' _content => $foo|stripHtml|truncate:500}
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

3303d ago

Major Versions

1.0.0 → 2.02017-06-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/312e788a47a251e05734378921d4596a91819b7de416fa18e77aa69e08798ea8?d=identicon)[Antik](/maintainers/Antik)

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/webchemistry-component-macro/health.svg)

```
[![Health](https://phpackages.com/badges/webchemistry-component-macro/health.svg)](https://phpackages.com/packages/webchemistry-component-macro)
```

###  Alternatives

[nette/code-checker

✅ Nette CodeChecker: A simple tool to check source code against a set of Nette coding standards.

891.7M6](/packages/nette-code-checker)[nextras/datagrid

Datagrid component for Nette Framework.

71270.4k4](/packages/nextras-datagrid)[efabrica/phpstan-latte

4511.9k](/packages/efabrica-phpstan-latte)[uestla/twigrid

Experimental DataGrid for Nette Framework

1712.3k2](/packages/uestla-twigrid)

PHPackages © 2026

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