ADmad

Results 347 comments of ADmad

`$this->getTableLocator()->get('NewAlias', ['className' => 'ReedemedFinishedBonus'])` will give you a new table instance with a different alias.

Instead of `I18n::setTranslator()` you can use `I18n::config()` to register loaders for new translators. The loader callable receives the domain name and locale as arguments. https://book.cakephp.org/3/en/core-libraries/internationalization-and-localization.html#creating-generic-translators

Well then you will have to simply bypass the use of translators and override the `__*()` functions with your own. Now due to limitation of composer you'll need to to...

The current `int|null|void` is ugly. Always returning an int from `execute()` shouldn't be too much trouble. We just need to update the bake template to include `return static::CODE_SUCCESS`.

I wouldn't want an unnecessary `filter_var()` check for each call to `HtmlHelper::link()`. Adding a separate `HtmlHelper::emailLink()` using the code you have shown would be fine.

> $this->Html->link('[email protected]', [], ['_mailto' => true]); This doesn't seem very convenient to use but I don't mind it. > $this->Html->link('mailto:[email protected]'); I don't like this because as you said it would...

This happens because `ValidationSet::$_allowEmpty` is `false` by default. One needs to explicitly use one of the `Validator::allowEmpty*()` methods to allow the field to be empty. This is a reasonable default...

> Its good to be any by default, but inconsistency between front-end and back-end should be fixed. Yes the inconsistency should be addressed.

So the issue occurs because of how `Validator::isEmpty()` works. Since no `allowEmpty*/notEmpty*()` call was used for the field, `validate()` calls `isEmpty()` with flag `Validator::EMPTY_NULL` (and value `''`) causing it to...

The TreeBehavior uses MPTT which is quite write heavy as the left/right values for multiple records need to be updated when a record is added/removed and hence not suitable for...