PHPackages                             othercode/fcontroller - 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. othercode/fcontroller

ActiveLibrary

othercode/fcontroller
=====================

FController is a container for controllers/modules.

v1.2.0(9y ago)061MITPHPPHP &gt;=5.3.3

Since Apr 23Pushed 8y agoCompare

[ Source](https://github.com/othercodes/fcontroller)[ Packagist](https://packagist.org/packages/othercode/fcontroller)[ RSS](/packages/othercode-fcontroller/feed)WikiDiscussions master Synced 2mo ago

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

FController
===========

[](#fcontroller)

[![Build Status](https://camo.githubusercontent.com/6de666899125b4b49b0549345ceb377e60a3c15b76b15be7e9cdb6d9c254e67d/68747470733a2f2f7472617669732d63692e6f72672f6f74686572636f6465732f66636f6e74726f6c6c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/othercodes/fcontroller) [![Latest Stable Version](https://camo.githubusercontent.com/4d0e3b13aedbab9f3b58e4cf92ce90e28c7fc16737848e988d771d7c0968251e/68747470733a2f2f706f7365722e707567782e6f72672f6f74686572636f64652f66636f6e74726f6c6c65722f762f737461626c65)](https://packagist.org/packages/othercode/fcontroller) [![License](https://camo.githubusercontent.com/318c6607b6d48f949f00ca87710715c79441699fcfaefb302e851c3a67c4628f/68747470733a2f2f706f7365722e707567782e6f72672f6f74686572636f64652f66636f6e74726f6c6c65722f6c6963656e7365)](https://packagist.org/packages/othercode/fcontroller)

FController is a container for controllers/modules. This package allow us to register several controllers/modules that can be called in a simply way from a common entry point. In the same way we can register multiple libraries or services. These services or libraries will be available in all modules.

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

[](#installation)

### With Composer

[](#with-composer)

First we have to add the dependencies to the ***composer.json*** file:

```
"require": {
    "othercode/fcontroller": "*",
}

```

Then we have to run the following command:

```
composer update
```

### Stand Alone

[](#stand-alone)

We need to download the package, then extract the content and include in your code the `fcontroller/autoload.php` file.

```
require_once 'fcontroller/autoload.php';
```

Basic Usage
-----------

[](#basic-usage)

First of all we must have the modules we want to the FController handle. For example we have this two dummy modules (classes):

```
namespace OtherCode\Examples;

class DummyOne extends \OtherCode\FController\Modules\BaseModule
{
    public function sayHello($name)
    {
        $this->storage->name = $name;

        return "Hello, " . $name . "!";
    }
}
```

The DummyOne Module has one method `sayHello($name)` that accepts one string as parameter. This method return us a string.

```
namespace OtherCode\Examples;

class DummyTwo extends \OtherCode\FController\Modules\BaseModule
{
    public function sayGoodBye()
    {
        return "GoodBye, " . $this->storage->name . "!";
    }
}
```

The DummyTwo Module has once again only one method named `sayGoodBye()`, this method also, return us a string.

Lets create a simply application that holds our two modules:

```
namespace OtherCode\Examples;

require_once 'fcontroller/autoload.php';
require_once 'DummyOne.php';
require_once 'DummyTwo.php';

$app = \OtherCode\FController\FController::getInstance();
$app->setModule('dummy1', 'OtherCode\Examples\DummyOne');
$app->setModule('dummy2', 'OtherCode\Examples\DummyTwo');

try {

    $response1 = $app->run("dummy1.sayHello", array('name' => 'Rick'));
    $response2 = $app->run("dummy2.sayGoodBye");

    var_dump($response1, $response2);

} catch (\Exception $e) {

    var_dump($e);
}
```

The code above illustrate how we can call two different modules using one entry point. Also we can use services inside our modules.

This package also has a message queue that can be used to display informative messages from our modules.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

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

Total

3

Last Release

3546d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7958790dcf5cd51ebbadc52fc7bada326fb3edd4481decf1006e6cfed8e46c43?d=identicon)[usantisteban](/maintainers/usantisteban)

---

Top Contributors

[![othercodes](https://avatars.githubusercontent.com/u/4815856?v=4)](https://github.com/othercodes "othercodes (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/othercode-fcontroller/health.svg)

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

PHPackages © 2026

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