PHPackages                             sw2eu/hotplug - 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. sw2eu/hotplug

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

sw2eu/hotplug
=============

v0.9.5(9y ago)237BSD

Since Jun 2Compare

[ Source](https://github.com/sw2eu/hotplug)[ Packagist](https://packagist.org/packages/sw2eu/hotplug)[ RSS](/packages/sw2eu-hotplug/feed)WikiDiscussions Synced yesterday

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

Hotplug - super simple plugins for Nette
========================================

[](#hotplug---super-simple-plugins-for-nette)

Nette has not any plugin or bundle management. If you want to split your application into multiple modules, you probably use the `includes` section of configuration files. This library will help you simplify this problem with a nice and simple way.

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

[](#requirements)

This library requires PHP 5.4 or higher. Hotplug is designed for [Nette Framework](https://github.com/nette/nette)currently for versions 2.3 and 2.4 (for more informations see [releases](https://github.com/nette/nette/releases)).

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

[](#installation)

The best way to install this library is using [Composer](http://getcomposer.org/):

```
$ composer require sw2eu/hotplug
```

Documentation
-------------

[](#documentation)

Firstly, you will use Hotplug configurator in your bootstrap file instead of classic `Nette\Configurator`:

```
$configurator = new Sw2\Hotplug\Configurator;
```

Now you can define your plugin directory. I use slightly different structure, but it is fully configurable:

```
$configurator->addPluginDirectory(__DIR__ . '/../src/Plugins');
// place before
$configurator->addConfig(...);
```

The hotplug configurator will search for any `config/hotplug.neon` in defined directory. For exaple:

- `src/Plugins/Admin/config/hotplug.neon`,
- `src/Plugins/Cms/Page/config/hotplug.neon`,
- etc.

This search is cached, so it is processed only first time when you build container. If you want to add new plugin, you have to manually delete hotplug cache (in file `temp/cache/_Sw2.Hotplug`).

That's all! Now you can define your plugin.

### Plugin Definition

[](#plugin-definition)

Every plugin must have defined configuration file `hotplug.neon`. In this file, you work like in any configuration file for Nette framework (maybe you can read [configuration section in documentation](https://doc.nette.org/en/2.4/configuring)).

You can also use variable `%pluginDir%` for locating files in your plugin directory, for example assets.

### Router Helpers

[](#router-helpers)

If you need add new router for your plugin, it is also supersimple. Hotplug is ready for this problem. In your application config define main application router like this:

```
# main application config
services:
    router: Sw2\Hotplug\Routers\RouterFactory::createRouter

```

Hotplug `RouterFactory` will search for any service with tag `router`. If you need to ensure sort of the routers, just name by alphabetic order. Or you can use naming conventions with sort number like this:

```
# this is in your hotplug.neon
services:
	router.999:
	    class: Nette\Application\Routers\Route
	    arguments: ['/[/]', 'Homepage:default']
	    autowired: FALSE
	    tags: [router]

```

Do not forget to set `autowired` to `FALSE`! If you need to add multiple routers and you want to define as `RouteList`, this library has a shortcut class `Sw2\Hotplug\Routers\RouteList` for this case:

```
# this is in your hotplug.neon
services:
	router.010:
		class: Sw2\Hotplug\Routers\RouteList('Admin')
		autowired: FALSE
		tags: [router]
		setup:
			- addRoute('admin/sign-in', 'Auth:signIn')
			- addRoute('admin/sign-out', 'Auth:signOut')
			- add(@otherRouterService)

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity57

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

Total

5

Last Release

3612d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1206903?v=4)[Lupo112](/maintainers/Lupo112)[@lupo112](https://github.com/lupo112)

### Embed Badge

![Health badge](/badges/sw2eu-hotplug/health.svg)

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

###  Alternatives

[nette/code-checker

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

911.7M6](/packages/nette-code-checker)[nette/web-project

Nette: Standard Web Project

10993.3k](/packages/nette-web-project)

PHPackages © 2026

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