Cakephp Tools Versions Save

A CakePHP Tools plugin containing lots of useful helpers, behaviors, components, shells, ...

3.6.3

1 month ago

Fixes

  • Fixed up DateTime difference()

3.6.2

2 months ago

Fixes

  • Fixed Sluggable behavior to not modify slug if the entity is not fully hydrated for the label fields.

3.6.1

2 months ago

Improvements

  • Allow local skip of trim in CommonComponent (per controller/action)

Fixes

  • Fixed ErrorHandlerTrait log404 config

3.6.0

3 months ago

Improvements

  • Added autoLink() / autoLinkUrls() improvements.

Fixes

  • Fixed Sluggable behavior to work with joined queries.

3.5.0

3 months ago

Improvements

  • Fixed up DateTime output for $this->Time->niceDate()
  • 404 detection (logging) also for badly behaving crawlers or search engines

3.4.0

3 months ago

Improvements

  • Added Encryption behavior

3.3.0

4 months ago

Improvements

Added Enum support for Bitmasked behavior

use App\Model\Enum\CommentStatus;

$this->Comments->addBehavior('Tools.Bitmasked', [
    'bits' => CommentStatus::class, 
    'mappedField' => 'statuses'],
);

By using an Enum for bits it will automatically switch the incoming and outcoming bit values to Enum instances.

You can also manually set the bits using an array, but then you would have to also set enum to the Enum class:

$this->Comments->addBehavior('Tools.Bitmasked', [
    'bits' => CommentStatus::tryFrom(CommentStatus::None->value)::options(), 
    'enum' =>  CommentStatus::class, 
    'mappedField' => 'statuses'],
);

Live demo: https://sandbox.dereuromark.de/sandbox/tools-examples/bitmask-enums

3.2.0

4 months ago

Improvements

Added EnumOptionsTrait as addon to your enums to have options() method available in your templates etc. It allows also narrowing and re-ordering of your enum options based on the use case.

use App\Model\Enum\UserStatus;

$options = UserStatus::options();
// or for narrowing/re-ordering
$options = UserStatus::options([UserStatus::ACTIVE, UserStatus::INACTIVE]);

echo $this->Form->control('status', ['options' => $options]);

3.1.2

4 months ago

Fixes

Fixed icon usage in templates.

3.1.1

5 months ago

Fixes

Fixed icon in template and helper for new Templating plugin support.