PHPackages                             sergiosgc/negotiated-output-components - 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. sergiosgc/negotiated-output-components

ActiveLibrary

sergiosgc/negotiated-output-components
======================================

Set of HTML components to be used with the negotiated-output templating system

10PHP

Since Oct 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sergiosgc/negotiated-output-components)[ Packagist](https://packagist.org/packages/sergiosgc/negotiated-output-components)[ RSS](/packages/sergiosgc-negotiated-output-components/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

negotiated-output-components
============================

[](#negotiated-output-components)

Set of HTML components to be used with the negotiated-output templating system

list.table
----------

[](#listtable)

list.table transforms an array of row values into a table. Example output:

[![propertylist.table example](docs/img/list.table.png)](docs/img/list.table.png)

### Example code

[](#example-code)

```
\sergiosgc\output\Negotiated::$singleton->template('/_/sergiosgc/list.table/',
    [ 'list' => [
    'class' => 'service-list',
    'columns' => [
        'name' => [
            'label' => _('Service'),
        ],
        'action' => [
            'label' => _('Actions'),
            'links' => [
                [
                    'href' => '/service/%',
                    'label' => _('View')
                ],
                [
                    'href' => '/service/edit/%',
                    'label' => _('Edit')
                ],
                [
                    'href' => '/service/%?x-verb=DELETE',
                    'class' => 'delete',
                    'label' => _('Delete')
                ]
            ]
        ]
    ],
    'rows' => $services
    ]]);

```

### Argument specification

[](#argument-specification)

list.table will act on the template variable `list`. This variable is an associative array containing these entries:

- **class**(optional) The HTML class of the resulting table
- **columns** Associative array of properties. Each property produces one column in the table. Each property is one of:
    - Value property. The key matches the a key in `list/rows/*` and the value is an associative array optionally containing a `label` entry.
    - Link set property. The key is irrelevant. The content is an associative array containing an optional `label` and a mandatory `links`associative array. Each entry in the `links` array contains:
        - **href** A format string to be fed into `\sergiosgc\sprintf` along with the current `list/rows` array, for producing the link href. You may use named conversion specifiers, as per the `\sergiosgc\sprintf` documentation.
        - ***label*** The link label
        - ***class***(optional) The link class
- **rows** A regular array of associative arrays (or \\ArrayAccess instances) of values. You must include values for value properties defined in `list/columns`. You may include extra values, namely for consumption by conversion specifiers in generating links.

html.element
------------

[](#htmlelement)

html.element produces generic HTML.

### Example code

[](#example-code-1)

```
\sergiosgc\output\Negotiated::$singleton->template('/_/sergiosgc/html.element/',
    ['html.element' => [
        'element' => 'div',
        '@class' => 'buttons',
        'children' => [
            [
                'element' => 'a',
                '@href' => '/reconfigure/
                '@class' => 'button',
                'children' => [
                    [
                        'text' => _('Reconfigure')
                    ]
                ]
            ],
            [
                'element' => 'a',
                '@href' => '/launch/
                '@class' => 'button primary',
                'children' => [
                    [
                        'text' => _('Launch')
                    ]
                ]
            ]
        ]
]]);

```

### Argument specification

[](#argument-specification-1)

html.element will act on a template variable named `html.element`. This variable contains a definition of an HTML node (either an element, HTML source or a text node).

For a text node, define a `text` entry, with the text.

For raw HTML, define a `raw` entry with the source code.

For an element entry, define:

- An **element** entry with the tag name of the element.
- An optional set of attribute entries, each named after the attribute name preceded by `@`.
- An optional `children` entry. If defined, it should be an array of associative arrays, where each associative array is an HTML element as defined in this argument specification.

menu.ul
-------

[](#menuul)

menu.ul transforms a menu definition into a menu defined as an recursing unordered list, suitable for producing main menus:

[![propertylist.table example](docs/img/menu.ul.png)](docs/img/menu.ul.png)

### Example code

[](#example-code-2)

```
\sergiosgc\output\Negotiated::$singleton->template('/_/sergiosgc/menu.ul/', [
    'menu' => [ 'items' => [
        [
            'href' => '/',
            'active' => true,
            'label' => _('Home')
        ],
        [
            'href' => '/hosts/',
            'label' => _('Hosts'),
            'submenu' => [
                [
                    'href' => '/host/new/',
                    'label' => _('New')
                ]
            ]
        ],
        [
            'href' => '/host-groups/',
            'label' => _('Host Groups'),
            'submenu' => [
                [
                    'href' => '/host-group/new/',
                    'label' => _('New')
                ]
            ]
        ],
        [
            'href' => '/services/',
            'label' => _('Services'),
            'submenu' => [
                [
                    'href' => '/service/new/',
                    'label' => _('New')
                ]
            ]
        ],
    ]
]);

```

### Argument specification

[](#argument-specification-2)

menu.ul acts on a template `menu` variable. This is an associative array, with an `items` entry defining the menu.

The `items` entry is an array of menu entries. Each menu entry is an associative array with a mandatory `label` and optional:

- **href** Link to be applied to label
- **active** Whether the menu entry is active
- **submenu** A submenu definition, as an array of menu entries.

paginator
---------

[](#paginator)

paginator produces a paginator, similar to this:

[![propertylist.table example](docs/img/paginator.png)](docs/img/paginator.png)

### Example code

[](#example-code-3)

```
\sergiosgc\output\Negotiated::$singleton->template('/_/sergiosgc/paginator/',
    [ 'paginator' => [
        'page' => $currentPage,
        'pageCount' => $pageCount,
        'visible' => 3,
        'queryArgumentsWhitelist' => [ 'q' ]
]]);

```

### Argument specification

[](#argument-specification-3)

paginator will act on a `paginator` template variable. This variable is an associative array with these mandatory parameters:

- **page** The current page
- **pageCount** The total number of pages

Additionally, these optional parameters may be defined:

- **class** HTML class for the paginator. Defaults to `paginator`.
- **visible** How many pages are visible. Defaults to 3.
- **linkHref** `\sergiosgc\sprintf` conversion specifier for generating page links. Conversion specifiers may refer to `page` for the linked page, as well as any variable defined in the paginator template variable. Defaults to %&lt;page&gt;
- **linkLabel** `\sergiosgc\sprintf` conversion specifier for generating page link labels. Conversion specifiers my refer to `page` for the linked page, as well as any variable defined in the paginator template variable. Defaults to %&lt;page&gt;
- **startLinkLabel** Label for the link to page 1. Defaults to `||`.
- **skipUpLinkLabel** Label for the link for skipping **visible** pages up. Defaults to `>>`.
- **skipDownLinkLabel** Label for the link for skipping **visible** pages down. Defaults to `template('/_/sergiosgc/propertylist.table/',
    [ 'property-list' => [
        'class' => 'hostgroup-view',
        'properties' => [
            'name' => [ 'label' => _('Name') ],
            'parent' => [ 'label' => _('Parent') ],
            'action' => [
                'label' => _('Actions'),
                'links' => [
                    [
                        'href' => '/host-group/edit/%',
                        'label' => _('Edit')
                    ],
                    [
                        'href' => '/host-group/%?x-verb=DELETE',
                        'class' => 'delete',
                        'label' => _('Delete')
                    ]
                ]
            ]
        ],
        'value' => $hostGroup
]]);

```

### Argument specification

[](#argument-specification-4)

propertylist.table will act on the template variable `property-list`. This variable is an associative array containing these entries:

- **class**(optional) The HTML class of the resulting table
- **properties** Associative array of properties. Each property produces one row in the table. Each property is one of:
    - Value property. The key matches the a key in `property-list/value` and the value is an associative array optionally containing a `label` entry.
    - Link set property. The key is irrelevant. The content is an associative array containing an optional `label` and a mandatory `links`associative array. Each entry in the `links` array contains:
        - **href** A format string to be fed into `\sergiosgc\sprintf` along with the `property-list/value` array, for producing the link href. You may use named conversion specifiers, as per the `\sergiosgc\sprintf` documentation.
        - ***label*** The link label
        - ***class***(optional) The link class
- **value** An associative array (or \\ArrayAccess instance) of values. You must include values for value properties defined in `property-list/properties`. You may include extra values, namely for consumption by conversion specifiers in generating links.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8b63f63e66eebd441a22d3dc5e6d46ea8759a2331de6a31d6f9e3b77dc40d2f?d=identicon)[sergiosgc](/maintainers/sergiosgc)

---

Top Contributors

[![sergiocarvalho-soomacom](https://avatars.githubusercontent.com/u/97310989?v=4)](https://github.com/sergiocarvalho-soomacom "sergiocarvalho-soomacom (39 commits)")[![sergiosgc](https://avatars.githubusercontent.com/u/174234?v=4)](https://github.com/sergiosgc "sergiosgc (13 commits)")

### Embed Badge

![Health badge](/badges/sergiosgc-negotiated-output-components/health.svg)

```
[![Health](https://phpackages.com/badges/sergiosgc-negotiated-output-components/health.svg)](https://phpackages.com/packages/sergiosgc-negotiated-output-components)
```

PHPackages © 2026

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