PHPackages                             windwalker/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. windwalker/controller

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

windwalker/controller
=====================

Windwalker Controller package

2.1.9(10y ago)024LGPL-2.0+PHPPHP &gt;=5.3.10

Since Oct 5Pushed 10y ago4 watchersCompare

[ Source](https://github.com/ventoviro/windwalker-controller)[ Packagist](https://packagist.org/packages/windwalker/controller)[ Docs](https://github.com/ventoviro/windwalker-controller)[ RSS](/packages/windwalker-controller/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (24)Used By (0)

Windwalker Controller
=====================

[](#windwalker-controller)

The Windwalker Controller package is a simple interface to control some business logic, id didn't dependency to any other packages. You may integrate it to any systems.

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

[](#installation-via-composer)

Add this to the require block in your `composer.json`.

```
{
    "require": {
        "windwalker/controller": "~2.0"
    }
}
```

Create Your Controller
----------------------

[](#create-your-controller)

```
use Windwalker\Controller\Controller;

class IndexController extends AbstractController
{
    public function execute()
    {
        return 'Index';
    }
}

$controller = new IndexController;

$output = $contorller->execute();
```

Windwakler Controller is a "Single Action Controller", follows single responsibility principle, every controller just maintain one task(action). It is inspired from [Joomla New MVC](http://magazine.joomla.org/issues/issue-nov-2013/item/1580-new-mvc-for-joomla-cms). You can create `IndexController`, `CreateController`, `UpdateController` and `DeleteController` for [CRUD](http://en.wikipedia.org/wiki/Create,_read,_update_and_delete).

Using Input and Application
---------------------------

[](#using-input-and-application)

By default, controller maintains an input and an application object. We can set it when construct:

```
use Windwalker\Controller\Controller;

class IndexController extends AbstractController
{
    public function execute()
    {
        // Get params from http request
        $method = $this->input->get('_method');

        $this->app->redirect('...');

        return true;
    }
}

$input = new Input;
$app = new WebApplication;

$controller = new IndexController($input, $app);

$output = $contorller->execute();
```

It didn't dependency to Windwalker self, you can push other framework's input and application into it:

```
$input = new Request;
$app = new HttpKernel;

$controller = new IndexController($input, $app);

$output = $contorller->execute();
```

HMVC
----

[](#hmvc)

Using [HMVC](http://en.wikipedia.org/wiki/Hierarchical_model%E2%80%93view%E2%80%93controller) in Windwalker controller is very easy:

```
class IndexController extends AbstractController
{
    public function execute()
    {
        $this->input->set('id', 123);

        $foo = new FooController($this->input, $this->app);

        echo $foo->execute();

        return true;
    }
}
```

Multi Action Controller
-----------------------

[](#multi-action-controller)

If you are familiar to common multiple action pattern, use `AbstractMultiActionController`:

```
use Windwalker\Controller\AbstractMultiActionController;

class ArticleController extends AbstractMultiActionController
{
    public function indexAction()
    {}

    public function saveAction($id = null, $data = array())
    {}

    public function deleteAction($id = null)
    {}
}

$controller = new ArticleController;

// Will call saveAction()
$controller->setActionName('save')
    ->setArguments(array(5, $data))
    ->execute();
```

If no action set, will call `doExecute()` instead, but you still need to override `doExecute()` first.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity68

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

Recently: every ~46 days

Total

22

Last Release

3748d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1639206?v=4)[Simon Asika](/maintainers/asika32764)[@asika32764](https://github.com/asika32764)

---

Top Contributors

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

---

Tags

frameworkcontrollerwindwalker

### Embed Badge

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

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

PHPackages © 2026

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