This plugin is PropertyStrategy of CakeDC/Enum
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
composer require k1low/property-enum
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',
]
]]);
}
}