model.getValidationAttributes

Called when fetching the model attributes to validate the model

Example usage from TranslatableBehavior class:

$model->bindEvent('model.getValidationAttributes', function ($attributes) { $locale = $this->translateContext(); if ($locale !== $this->translatableDefault) { return array_merge($attributes, $this->getTranslateDirty($locale)); } });

Usage

Triggers

Copyright © 2024 Winter CMS