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

AbandonedCraft-plugin

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

A simple plugin for inlining stuff in your templates.

2.1.1(7y ago)64118.2k↓36.4%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 1mo 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

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity42

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

2781d 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

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)[verbb/social-poster

Automatically post entries to social media.

918.5k](/packages/verbb-social-poster)[acclaro/translations

Easily launch and manage multilingual Craft websites without having to copy/paste content or manually track updates.

1229.5k](/packages/acclaro-translations)

PHPackages © 2026

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