PHPackages                             fede91it/fof-nnrelation - 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. fede91it/fof-nnrelation

ActiveLibrary[Framework](/categories/framework)

fede91it/fof-nnrelation
=======================

FOF (Framework on Framework) support for many-to-many relations.

v1.1.1(11y ago)219[1 issues](https://github.com/fede91it/fof-nnrelation/issues)PHPPHP &gt;=5.3.0

Since Sep 29Pushed 11y ago2 watchersCompare

[ Source](https://github.com/fede91it/fof-nnrelation)[ Packagist](https://packagist.org/packages/fede91it/fof-nnrelation)[ RSS](/packages/fede91it-fof-nnrelation/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

F0F NNRelation
==============

[](#f0f-nnrelation)

FOF NNRelation add support to many-to-many relations into FOF (Framework on Framework). In truth it's for FOF! It consist in a set of one F0FTableBehavior, one F0FModelBehavior and one F0FFormField. Add all these magic classes to get ready to use multiple relations (with pivot tables) in your F0F projects, with ease!

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

[](#requirements)

1. Joomla 3.x (it should works also with 2.5.x)
2. FOF 2.3.x or greater (download [Framework on Framework](https://www.akeebabackup.com/download/fof.html)

Preparation
-----------

[](#preparation)

1. Install `lib_f0f-nnrelation-1.0.0.tgz` library extension
2. Create a `dispatcher.php` file for your FOF component
3. Override the method `onBeforeDispatch`
4. Before calling `parent::onBeforeDispatch` include f0f-nnrelation in this way:

```
class FoobarDispatcher extends F0FDispatcher
{
  public function onBeforeDispatch()
  {
    // Add multiple to multiple relations support
    jimport('f0f-nnrelation.fields.nnrelation');
    jimport('f0f-nnrelation.fields.header.nnrelation');
    jimport('f0f-nnrelation.models.nnrelation');
    jimport('f0f-nnrelation.tables.nnrelation');

    return parent::onBeforeDispatch();
  }
}
```

Usage
-----

[](#usage)

#### Table Behavior

[](#table-behavior)

In your `form.form.xml` files you can use a new type of field called `nnrelation`.

```

```

The name attribute **must** be the same of the name of the multiple relation you declared in the `fof.xml` file. In the exemple above, the multiple relation I want to manage is declared in this way:

```

  nnrelation

```

As you see, you **must** enable the specific FOF behavior for the table in which you want to use the multiple relation. In this example, the multiple relation will be automagically managed for all `team` items that want to trace their `players`. If you want to do viceversa, you have to declare the contrary `teams` relation for the `player` table, and enabling the behavior there. The names respects the standard FOF singular/plural conventions.

### Model Behavior

[](#model-behavior)

In the front-end of your component you want to retrieve your multiple relations with ease. For this purpose you can enable the `nnrelation` behavior for a view, and if here there is a multiple relation declared, all related items will be automagically retrieved.

```

    nnrelation

```

Now in your list views, the `$this->items` data object will contains a property named as the relation. Instead, you will have `$this->item` in a item view.

```
stdClass Object
(
  [title] => Foobar Team
  [players] => stdClass Object
    (
      [0] => Array
        (
          [title] => John
          [...] => ...
        )
      [2] => ...
    )
)

```

### Form Field

[](#form-field)

In your `form.default.xml` files you can use a new type of field called `nnrelation`.

```

```

Also in this case, the name of the field should reflect the name of the multiple relation declared in `fof.xml`. The other attribures are inherited from the `list` form type (see FOF documentation). The placeholder `[ITEM:FOOBAR_PLAYER_ID]` is the name of the key value for your referred table, in the pivot table.

### Form Header

[](#form-header)

Coming Soon...

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 76.7% 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 ~27 days

Total

3

Last Release

4241d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1036b954dc48abb0e7a687352c2b5c1ea79b443c9035876d183099e82c758ddc?d=identicon)[fede91it](/maintainers/fede91it)

---

Top Contributors

[![f-liva](https://avatars.githubusercontent.com/u/346224?v=4)](https://github.com/f-liva "f-liva (23 commits)")[![peterpeter](https://avatars.githubusercontent.com/u/485313?v=4)](https://github.com/peterpeter "peterpeter (7 commits)")

### Embed Badge

![Health badge](/badges/fede91it-fof-nnrelation/health.svg)

```
[![Health](https://phpackages.com/badges/fede91it-fof-nnrelation/health.svg)](https://phpackages.com/packages/fede91it-fof-nnrelation)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M299](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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