public function onRegisterValidate(&$post) { $value = !empty($post[$this->inputName]['date']) ? $post[$this->inputName]['date'] : ''; if (!$this->checkAge($value)) { return false; } return parent::onRegisterValidate($post); }
public function onRegisterValidate(&$post) { $value = isset($post[$this->inputName]) ? $post[$this->inputName] : ''; $json = FD::json(); $value = $json->isJsonString($value) ? $json->decode($value) : (object) array(); $date = isset($value->date) ? $value->date : ''; if (!$this->checkAge($date)) { return false; } return parent::onRegisterValidate($post); }