PHPackages                             rrd108/cakephp-datalist - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rrd108/cakephp-datalist

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

rrd108/cakephp-datalist
=======================

Datalist plugin for CakePHP 3

1.1.1(7y ago)6594MITPHP

Since Jul 6Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rrd108/cakephp-datalist)[ Packagist](https://packagist.org/packages/rrd108/cakephp-datalist)[ Docs](https://github.com/rrd108/cakephp-datalist)[ RSS](/packages/rrd108-cakephp-datalist/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (7)Dependencies (2)Versions (9)Used By (0)

[![Build Status](https://camo.githubusercontent.com/47680f68b72916f1bab287efe76560ab4b785248a761a8e4008a5130db656d42/68747470733a2f2f7472617669732d63692e6f72672f7272643130382f63616b657068702d646174616c6973742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rrd108/cakephp-datalist)[![codecov](https://camo.githubusercontent.com/a2a0ff14c18ffa51fb42e274a916b43561168da5ca3e6610594459a0cd250a86/68747470733a2f2f636f6465636f762e696f2f67682f7272643130382f63616b657068702d646174616c6973742f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/rrd108/cakephp-datalist)

Datalist plugin for CakePHP
===========================

[](#datalist-plugin-for-cakephp)

Many of the HTML 5 new widgets are automatically supported by CakePHP. Unfortunatelly [datalist](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) is not supported by default.

With the *datalist* HTML 5 element you can create a widget similar to *select* elements, but with *datalist* you are not forced to select one of the options, but you can add any new value also.

If you are looking for plain *datalist* support by a CakePHP plugin you should check [dereuromark/cakephp-tools](https://github.com/dereuromark/cakephp-tools)

This plugin adds an extra feature on a plain *datalist*. If you create a new option, than CakePHP will save the value in the associted model as a new record.

Backward compatibility
----------------------

[](#backward-compatibility)

From version 1.0.0 we have renamed the widget, so in the `AppView.php` and in your template files you should use `datalistJs` instead of `datalist` as described below. Sorry for breaking backward compatibility, but there were only a few installs of the previous versions and as [dereuromark/cakephp-tools](https://github.com/dereuromark/cakephp-tools) implemented plain *datalist*, this was the easiest way to do...

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install the plugin is via composer:

```
composer require rrd108/cakephp-datalist

```

Than you should load the plugin by issuing the following command in your terminal.

```
bin/cake plugin load Datalist

```

As the plugin extends the core HTML widgets you should load the form helper in your `/src/View/AppView.php` file like this:

```
public function initialize()
{
    parent::initialize();
    $this->loadHelper('Form', [
        'templates' => 'Datalist.form-templates',
        'widgets' => [
            'datalistJs' => ['Datalist\View\Widget\DatalistJsWidget']
        ]
    ]);
}
```

Usage
-----

[](#usage)

In any model where you want to use *datalist* you should add *datalist* behavior. For example in your `/src/Model/Table/SkillsTable.php` you should have the following code, where `Languages` should be associated to `SkillsTable` and `name` is the field on what we want to use *datalist*.

```
public function initialize(array $config)
{
    parent::initialize($config);

    $this->addBehavior(
        'Datalist.Datalist',
        ['Languages' => 'name']
    );

    $this->belongsTo('Languages', [
        'foreignKey' => 'language_id',
        'joinType' => 'INNER'
        ]);
}
```

If you want more datalists you can add more models to the behavior.

```
$this->addBehavior(
    'Datalist.Datalist',
    ['Languages' => 'name', 'Countries' => 'country']
);
}
```

Than in your controller you do a simple find operation and set the result to the view.

```
//src/Controller/SkillsController.php
public function add()
{
    // your controller code
    $languages = $this->Skills->Languages->find('list', ['limit' => 200]);
    $this->set(compact('languages'));
}
```

By this the `$languages` variable is available at `/src/Template/Skills/add.ctp`file.

```

```

The end result should work like a charm and if you do not select one of the options but type in a new one, CakePHP will save it as a new entry in the associated model. [![Alt Text](https://camo.githubusercontent.com/dfe604de70a912dc234d8535bcafd14775e475f5873b1c6589ddb5023e2088c0/687474703a2f2f7765626d616e69612e63632f7374617469632f63616b657068702f646174616c6973742e676966)](https://camo.githubusercontent.com/dfe604de70a912dc234d8535bcafd14775e475f5873b1c6589ddb5023e2088c0/687474703a2f2f7765626d616e69612e63632f7374617469632f63616b657068702f646174616c6973742e676966)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~33 days

Total

7

Last Release

2776d ago

Major Versions

0.0.4 → 1.0.02018-07-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f115ed63db719bb70b5f9f74a077e5dba1e3962d394f63bde914de8f64171d8?d=identicon)[rrd](/maintainers/rrd)

---

Top Contributors

[![rrd108](https://avatars.githubusercontent.com/u/3147489?v=4)](https://github.com/rrd108 "rrd108 (30 commits)")[![challgren](https://avatars.githubusercontent.com/u/88909?v=4)](https://github.com/challgren "challgren (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rrd108-cakephp-datalist/health.svg)

```
[![Health](https://phpackages.com/badges/rrd108-cakephp-datalist/health.svg)](https://phpackages.com/packages/rrd108-cakephp-datalist)
```

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

333972.2k49](/packages/dereuromark-cakephp-tools)[cakedc/cakephp-phpstan

CakePHP plugin extension for PHPStan.

42776.5k46](/packages/cakedc-cakephp-phpstan)[dereuromark/cakephp-dto

A CakePHP plugin for generating immutable Data Transfer Objects with full type safety

3096.0k5](/packages/dereuromark-cakephp-dto)[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

35184.7k2](/packages/dereuromark-cakephp-setup)[dereuromark/cakephp-calendar

A CakePHP plugin to easily create calendars.

1674.7k1](/packages/dereuromark-cakephp-calendar)[dereuromark/cakephp-flash

A CakePHP plugin around powerful flash message handling.

1229.9k2](/packages/dereuromark-cakephp-flash)

PHPackages © 2026

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