PHPackages                             ikkez/f3-template-sections - 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. ikkez/f3-template-sections

ActiveLibrary[Templating &amp; Views](/categories/templating)

ikkez/f3-template-sections
==========================

Sections support for the F3 Template engine

v1.1.0(3y ago)83702[1 issues](https://github.com/ikkez/f3-template-sections/issues)GPL-3.0PHP

Since Feb 22Pushed 3y ago3 watchersCompare

[ Source](https://github.com/ikkez/f3-template-sections)[ Packagist](https://packagist.org/packages/ikkez/f3-template-sections)[ Docs](https://github.com/ikkez/f3-template-sections)[ RSS](/packages/ikkez-f3-template-sections/feed)WikiDiscussions master Synced today

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

Template sections
=================

[](#template-sections)

This addon introduces *template inheritance* via **sections** for the [F3](https://github.com/bcosca/fatfree) template engine.

Install
-------

[](#install)

To install with composer, just run `composer require ikkez/f3-template-sections`.
In case you do not use composer, add the `src/` folder to your `AUTOLOAD` path or copy the files from `src/` into your libs.

Initialize
----------

[](#initialize)

To use the new directives, you need to register them:

Init:

```
\Template\Tags\Section::init('section');
\Template\Tags\Inject::init('inject');
```

Usage
-----

[](#usage)

Imagine this main site template:

```

		Site Name

```

You see we have create a section with `id=sidebar`. This section can contain default content already if you want, but within `article.html` you can now inject content to the sidebar, which is actually in a parent level:

```

		Fear me parrot
		Arrr

Fear me parrot, ye evil whale!
All comrades sail gutless, stormy jacks. Ho-ho-ho! hunger of riddle.

Arrr, fine hunger!
What’s the secret to canned and sun-dried zucchini? Always use quartered rum.
```

That's basically it. There are some more modes for injecting content:

### Append / Prepend

[](#append--prepend)

In this example we have a breadcrumb navigation. You can change the generated tag-element with the `tag`-attribute.

```

		Home

```

By default the content in the section is replaced upon inject. If you wish, you just append the existing content like this:

```

	Wiki

```

You can also use `prepend` as inject mode.

### Rendering locally

[](#rendering-locally)

You can switch the model to use local variables instead of rendering the content in the injected section. This is useful when you iterate over an array of data within a `` block.

```

			{{@item.content}}
			{{@item.title}}

					{{@item.modal}}

```

API
---

[](#api)

### section

[](#section)

Attributes:

- `section`
    Used to identify the new section.
- `id`
    Alias to `section`, but the `id` attribute will be visible in the final markup.
- `tag`
    The tag-element name of the final section. Default: `section`.
    When you set `tag="FALSE"`, the section content is not wrapped into any element.

Any other attributes are just passed to the final tag element.

### inject

[](#inject)

Attributes:

- `section`
    Used to identify the destination section.
- `id`
    Alias to `section`.
- `mode`
    The injection mode for content:
    **overwrite** (default): replaces the existing content in the section
    **append**: adds content after the existing content
    **prepend**: adds content before the existing content
- `local`
    Render element locally with existing variables first

Licence
-------

[](#licence)

GPLv3

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

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

Total

2

Last Release

1357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84cac52f5889d2bf6e710f2139dfc884824b2d7ce9c48a3bfe90704a94c85722?d=identicon)[ikkez](/maintainers/ikkez)

---

Top Contributors

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

---

Tags

fat-free-frameworktemplatestemplatesectionF3fatfree

### Embed Badge

![Health badge](/badges/ikkez-f3-template-sections/health.svg)

```
[![Health](https://phpackages.com/badges/ikkez-f3-template-sections/health.svg)](https://phpackages.com/packages/ikkez-f3-template-sections)
```

###  Alternatives

[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.5k34.7M186](/packages/phpoffice-phpword)[rize/uri-template

PHP URI Template (RFC 6570) supports both expansion &amp; extraction

420137.3M46](/packages/rize-uri-template)[goomento/module-page-builder

Goomento - The Free Magento Page Builder Extension, allows you to create unique Magento websites, landing pages using advanced animations, custom CSS, responsive designs, and more, without a line of code.

10413.0k2](/packages/goomento-module-page-builder)[mopa/bootstrap-sandbox-bundle

Seperate live docs from code

256.8k](/packages/mopa-bootstrap-sandbox-bundle)[larablocks/pigeon

A more flexible email message builder for Laravel 5 including chained methods, reusable message configurations, and message layout and template view management.

143.7k](/packages/larablocks-pigeon)

PHPackages © 2026

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