protected function formatDataValue($formatString, $value)
{
if ($formatString === '') {
return TPropertyValue::ensureString($value);
} else {
if ($formatString[0] === '#') {
$expression = strtr(substr($formatString, 1), array('{0}' => '$value'));
try {
if (eval("\$result={$expression};") === false) {
throw new Exception('');
}
return $result;
} catch (Exception $e) {
throw new TInvalidDataValueException('listcontrol_expression_invalid', get_class($this), $expression, $e->getMessage());
}
} else {
return sprintf($formatString, $value);
}
}
}