'PHP Laminas DoctrineObjectInputFilter get value of other property in Callback input filter
I am working with Laminas DoctrineObjectInputFilter
and want to get value of other property in Callback input filter like this code is in init function of Filter
class which extends DoctrineObjectInputFilter
// input filter whose value is required
$this->add([
'name' => 'name',
'allow_empty' => false,
'filters' => []
]);
// Input filter in which I want value of input name
$this->add([
'name' => 'value',
'allow_empty' => true,
'filters' => [
[
'name' => 'Callback',
'options' => [
'callback' => function ($value) {
$name = // want to get property name value here
if (key_exists($name, $this->applicationConfig) && gettype($value) === 'string') {
return trim(strip_tags($value));
}
else {
return trim($value);
}
return $value;
},
],
],
],
]);
have checked $this->getRawValues()
but its returning null for all inputs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|