5 class Date extends \Rsi\Fred\Controller\View\Html\Widget{
8 $length = strlen(preg_replace(
'/\\w/',
'??',str_replace(
'Y',
'????',$format = $this->_widget->local->dateFormat)));
9 $attribs = [
'maxlength' => $length,
'size' => $length];
10 if($words = $this->_view->component(
'trans')->str($this->_widget->placeholder))
try{
11 $words = \Rsi\Record::explode($words,
';',
'=');
13 foreach(str_split($format) as $char) $placeholder .= $words[$char] ?? $char;
14 $attribs[
'placeholder'] = $placeholder;
17 $this->_view->component(
'log')->warning(
"Invalid placeholder '$words': " . $e->getMessage());
19 return array_merge(parent::attribs(),$attribs);