Skip to content

Property based enum plugin for CakePHP 3

Notifications You must be signed in to change notification settings

giginc/property-enum

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 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

Packages

 
 
 

Languages

  • PHP 100.0%