k1low/property-enum

Property based enum plugin for CakePHP 3

Fund package maintenance!
k1LoW

Installs: 22 528

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 3

Forks: 5

Open Issues: 3

Type:cakephp-plugin

v1.4.0 2019-03-29 16:45 UTC

This package is auto-updated.

Last update: 2024-12-29 05:21:38 UTC


README

This plugin is PropertyStrategy of CakeDC/Enum

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

composer require k1low/property-enum

Property Example

class ArticlesTable extends Table
{
    public $enums = [
        'status' => [
            'public' = 'Published';
            'draft' = 'Drafted';
            'archive' = 'Archived';
        ],
    ];

    public function initialize(array $config)
    {
        $this->addBehavior('PropertyEnum.Enum', ['lists' => [
            'status' => [
                'strategy' => 'property',
            ]
        ]]);
    }
}

for CakePHP 2

see https://github.com/k1LoW/Enumm