Skip to content

k1LoW/property-enum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Property based enum plugin for CakePHP 3 Travis

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

About

Property based enum plugin for CakePHP 3

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages