Skip to content

Releases: dereuromark/cakephp-tools

3.5.0

07 Feb 23:34
Compare
Choose a tag to compare

Improvements

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

3.4.0

23 Jan 06:28
ed75342
Compare
Choose a tag to compare

Improvements

  • Added Encryption behavior

3.3.0

04 Jan 22:56
Compare
Choose a tag to compare

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

25 Dec 19:02
Compare
Choose a tag to compare

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

21 Dec 00:03
Compare
Choose a tag to compare

Fixes

Fixed icon usage in templates.

3.1.1

11 Dec 22:28
Compare
Choose a tag to compare

Fixes

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

3.1.0

27 Nov 20:49
Compare
Choose a tag to compare

Fixes

Fixed custom finders to leverage new named params.

Note: This has a BC breaking nature, but was necessary to fix up quickly after the 3.0 release.

3.0.0

30 Oct 10:34
Compare
Choose a tag to compare

CakePHP 5 compatible release

Main changes:

  • Number and DateTime classes are now in I18n namespace instead of Utility, following core namespacing.

Enjoy!

2.6.1

26 Oct 10:10
Compare
Choose a tag to compare

Fixes

Removed deprecation that was invalid anyways.

2.6.0

25 Oct 17:11
20ff734
Compare
Choose a tag to compare

Improvements

Removed deprecations