A CakePHP Tools plugin containing lots of useful helpers, behaviors, components, shells, ...
MIT License
Published by dereuromark 2 months ago
Published by dereuromark 4 months ago
Table::relatedInUse()
Included commits: https://github.com/dereuromark/cakephp-tools/compare/3.6.3...3.6.4
Published by dereuromark 7 months ago
Published by dereuromark 8 months ago
Published by dereuromark 8 months ago
Published by dereuromark 9 months ago
Published by dereuromark 9 months ago
DateTime
output for $this->Time->niceDate()
Published by dereuromark 9 months ago
Published by dereuromark 10 months ago
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
Published by dereuromark 10 months ago
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]);
Published by dereuromark 10 months ago
Fixed icon usage in templates.
Published by dereuromark 11 months ago
Fixed icon in template and helper for new Templating plugin support.
Published by dereuromark 11 months ago
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.
Published by dereuromark 12 months ago
Main changes:
Enjoy!
Published by dereuromark about 1 year ago
Removed deprecation that was invalid anyways.
Published by dereuromark about 1 year ago
Removed deprecations
Published by dereuromark about 1 year ago
Please test, once confirmed we can release stable.
Published by dereuromark over 1 year ago
detectHttps
configPublished by dereuromark over 1 year ago
Added an option to check the existence of Icon::render()
icon names instead of silently displaying empty (no) icon.