PHPackages                             joomla/controller - 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. [Framework](/categories/framework)
4. /
5. joomla/controller

ActiveJoomla-package[Framework](/categories/framework)

joomla/controller
=================

Joomla Controller Package

4.0.0(9mo ago)387.2k↑225%51GPL-2.0-or-laterPHPPHP ^8.3.0CI passing

Since Jun 4Pushed 9mo ago13 watchersCompare

[ Source](https://github.com/joomla-framework/controller)[ Packagist](https://packagist.org/packages/joomla/controller)[ Docs](https://github.com/joomla-framework/controller)[ RSS](/packages/joomla-controller/feed)WikiDiscussions 3.x-dev Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (19)Used By (1)

The Controller Package [![Build Status](https://github.com/joomla-framework/controller/actions/workflows/ci.yml/badge.svg?branch=3.x-dev)](https://github.com/joomla-framework/controller)
==========================================================================================================================================================================================

[](#the-controller-package-)

[![Latest Stable Version](https://camo.githubusercontent.com/62140a070b1de0aa958c36547961675299ce291b08150af0fc5d6a9e03f2d6cf/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6d6c612f636f6e74726f6c6c65722f762f737461626c65)](https://packagist.org/packages/joomla/controller)[![Total Downloads](https://camo.githubusercontent.com/56589939dd8e97e902c2996d94a2cf09d14f7ad97508e47b3eea97b5832d80b4/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6d6c612f636f6e74726f6c6c65722f646f776e6c6f616473)](https://packagist.org/packages/joomla/controller)[![Latest Unstable Version](https://camo.githubusercontent.com/2d6808a43a91f294061c0bcb2a3c12b9471f8da6f2fa35f8c45757fb94ee425a/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6d6c612f636f6e74726f6c6c65722f762f756e737461626c65)](https://packagist.org/packages/joomla/controller)[![License](https://camo.githubusercontent.com/e4bcf3d9fe01512b40df9583381599a11a4d4b09853019d6b6602de45ec75bcf/68747470733a2f2f706f7365722e707567782e6f72672f6a6f6f6d6c612f636f6e74726f6c6c65722f6c6963656e7365)](https://packagist.org/packages/joomla/controller)

Interfaces
----------

[](#interfaces)

### `Controller\ControllerInterface`

[](#controllercontrollerinterface)

`Controller\ControllerInterface` is an interface that requires a class to be implemented with the following methods:

- `execute`
- `getApplication`
- `getInput`
- `setApplication`
- `setInput`

Classes
-------

[](#classes)

### `Controller\AbstractController`

[](#controllerabstractcontroller)

#### Construction

[](#construction)

The constructor for `Controller\AbstractController` takes an optional `Joomla\Input\Input` object and an optional `Joomla\Application\AbstractApplication` object. One or the other can be omitted but using `getApplication` or `getInput` without setting them will throw an exception.

#### Usage

[](#usage)

The `Controller\AbstractController` class is abstract so cannot be used directly. The derived class must implement the execute method to satisfy the interface requirements. Note that the execute method no longer takes a "task" argument as each controller class. Multi-task controllers are still possible by overriding the execute method in derived classes. Each controller class should do just one sort of 'thing', such as saving, deleting, checking in, checking out and so on. However, controllers, or even models and views, have the liberty of invoking other controllers to allow for HMVC architectures.

```
namespace Examples;

use Joomla\Application;
use Joomla\Input;

/**
 * My custom controller.
 *
 * @since  1.0
 */
class MyController extends Controller\Base
{
	/**
	 * Executes the controller.
	 *
	 * @return  void
	 *
	 * @since   1.0
	 * @throws  \RuntimeException
	 */
	public function execute()
	{
		echo time();
	}
}

// We'll assume we've already defined an application in this namespace.
$app = new ExampleApplication;
$input = new Input\Input;

// Instantiate the controller.
$controller = new MyController($input, $app);

// Print the time.
$controller->execute();
```

#### Serialization

[](#serialization)

The `Controller\AbstractController` class implements `Serializable`. When serializing, only the input property is serialized. When unserializing, the input variable is unserialized and the internal application property is loaded at runtime.

Installation via Composer
-------------------------

[](#installation-via-composer)

Add `"joomla/controller": "~3.0"` to the require block in your composer.json and then run `composer install`.

```
{
	"require": {
		"joomla/controller": "~3.0"
	}
}
```

Alternatively, you can simply run the following from the command line:

```
composer require joomla/controller "~3.0"
```

If you want to include the test sources, use

```
composer require --prefer-source joomla/controller "~3.0"
```

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance55

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 50.4% 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 ~316 days

Recently: every ~266 days

Total

15

Last Release

299d ago

Major Versions

1.1.2 → 2.0.0-beta2020-06-05

2.0.1 → 3.0.02023-10-05

3.0.2 → 4.0.02025-07-24

PHP version history (6 changes)1.0-alphaPHP &gt;=5.3.10

2.0.0-betaPHP ^7.2.5

2.0.0PHP ^7.2.5|^8.0

2.0.1PHP ^7.2.5|~8.0.0|~8.1.0

3.0.0PHP ^8.1.0

4.0.0PHP ^8.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/305a2164440014dcef9ac681c139fe5e8a1ce1d7a8c3b3cfb828497729a4c70e?d=identicon)[wilsonge](/maintainers/wilsonge)

---

Top Contributors

[![mbabker](https://avatars.githubusercontent.com/u/368545?v=4)](https://github.com/mbabker "mbabker (61 commits)")[![Hackwar](https://avatars.githubusercontent.com/u/313866?v=4)](https://github.com/Hackwar "Hackwar (23 commits)")[![dongilbert](https://avatars.githubusercontent.com/u/718028?v=4)](https://github.com/dongilbert "dongilbert (10 commits)")[![nibra](https://avatars.githubusercontent.com/u/827605?v=4)](https://github.com/nibra "nibra (7 commits)")[![wilsonge](https://avatars.githubusercontent.com/u/1986000?v=4)](https://github.com/wilsonge "wilsonge (4 commits)")[![heelc29](https://avatars.githubusercontent.com/u/66922325?v=4)](https://github.com/heelc29 "heelc29 (3 commits)")[![ianmacl](https://avatars.githubusercontent.com/u/176534?v=4)](https://github.com/ianmacl "ianmacl (3 commits)")[![realityking](https://avatars.githubusercontent.com/u/628508?v=4)](https://github.com/realityking "realityking (3 commits)")[![rdeutz](https://avatars.githubusercontent.com/u/467356?v=4)](https://github.com/rdeutz "rdeutz (2 commits)")[![joomla-jenkins](https://avatars.githubusercontent.com/u/929228?v=4)](https://github.com/joomla-jenkins "joomla-jenkins (2 commits)")[![PhilETaylor](https://avatars.githubusercontent.com/u/400092?v=4)](https://github.com/PhilETaylor "PhilETaylor (1 commits)")[![richard67](https://avatars.githubusercontent.com/u/7413183?v=4)](https://github.com/richard67 "richard67 (1 commits)")[![eddieajau](https://avatars.githubusercontent.com/u/700871?v=4)](https://github.com/eddieajau "eddieajau (1 commits)")

---

Tags

controllerjoomlajoomla-frameworkmvcphpframeworkcontrollerjoomla

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/joomla-controller/health.svg)

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

###  Alternatives

[joomla/filter

Joomla Filter Package

151.4M8](/packages/joomla-filter)[joomla/application

Joomla Application Package

23404.8k11](/packages/joomla-application)[joomla/registry

Joomla Registry Package

16468.6k20](/packages/joomla-registry)[joomla/filesystem

Joomla Filesystem Package

12369.7k7](/packages/joomla-filesystem)[joomla/oauth2

Joomla OAuth2 Package

10303.1k2](/packages/joomla-oauth2)[joomla/router

Joomla Router Package

10285.4k1](/packages/joomla-router)

PHPackages © 2026

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