PHPackages                             aelvan/inlin - 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. aelvan/inlin

AbandonedCraft-plugin[Templating &amp; Views](/categories/templating)

aelvan/inlin
============

A simple plugin for inlining stuff in your templates.

2.1.1(7y ago)64118.7k↓75.8%10MITPHP

Since Aug 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aelvan/Inlin-Craft)[ Packagist](https://packagist.org/packages/aelvan/inlin)[ RSS](/packages/aelvan-inlin/feed)WikiDiscussions craft3 Synced 2d ago

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

Inlin for Craft
===============

[](#inlin-for-craft)

A tiny plugin for inlining files in Craft templates.

*This is the Craft 3.x version of Inlin, for the Craft 2.x version see the [master branch](https://github.com/aelvan/Inlin-Craft/tree/master).*

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

[](#requirements)

This plugin requires Craft CMS 3.0.0 or later.

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

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require aelvan/inlin

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Inlin.

Usage
-----

[](#usage)

Use it like this:

```
{{ craft.inlin.er('/build/svg/my.svg') | raw }}

{{ craft.inlin.er('/build/js/my.js') | raw }}

{{ craft.inlin.er('/build/css/my.css') | raw }}

```

Why? [Sometimes](http://css-tricks.com/svg-sprites-use-better-icon-fonts/) it [makes sense](http://www.yottaa.com/blog/bid/306224/Inlining-for-Performance-When-to-Let-the-Cache-Go), performance or workflow wise, to inline resources instead of requesting them.

To include a remote file, pass in true as the second parameter:

```
{{ craft.inlin.er('http://example.com/remote/path.svg', true) | raw }}

```

Warning
-------

[](#warning)

Understand that inserting filedata in your templates, especially when passing it through Twig's raw filter, is a potential security risk. And the path is relative to your document root, so the path could point to a file anywhere on your server. **Make sure you never, ever let a third party control what is inserted.**In case you're thinking "meh", insert this into your template:

```
{{ craft.inlin.er('/../config/db.php') | raw }}

```

*"With great power, comes great responsibility" -Voltaire*

Configuration
-------------

[](#configuration)

Inlin needs to know the public document root to know where your files are located. By default Inlin will use `@webroot`, but on some server configurations this is not the correct path. You can configure the path by creating a config file called `inline.php` in your config folder, and adding the `publicRoot` setting.

#### Example

[](#example)

```
'publicRoot' => '/path/to/website/public/',

```

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 77.3% 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 ~211 days

Total

3

Last Release

2827d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2675644?v=4)[André Elvan](/maintainers/aelvan)[@aelvan](https://github.com/aelvan)

---

Top Contributors

[![aelvan](https://avatars.githubusercontent.com/u/2675644?v=4)](https://github.com/aelvan "aelvan (17 commits)")[![davist11](https://avatars.githubusercontent.com/u/199985?v=4)](https://github.com/davist11 "davist11 (4 commits)")[![brandonkelly](https://avatars.githubusercontent.com/u/47792?v=4)](https://github.com/brandonkelly "brandonkelly (1 commits)")

---

Tags

craft2craft3craftcmscraftcms-plugininlineworkflowsvgcmsinliningCraftcraftcmscraft-plugininlinecriticalcss

### Embed Badge

![Health badge](/badges/aelvan-inlin/health.svg)

```
[![Health](https://phpackages.com/badges/aelvan-inlin/health.svg)](https://phpackages.com/packages/aelvan-inlin)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[wbrowar/guide

A CMS Guide for Craft CMS.

6154.7k1](/packages/wbrowar-guide)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/footnotes

Adds a footnotes feature to CKEditor fields and Twig templates.

213.6k](/packages/verbb-footnotes)[verbb/events

A full-featured plugin for event management and ticketing.

2311.9k](/packages/verbb-events)

PHPackages © 2026

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