Preprocessor is defined for specific result column and applies on each record.
use Tlapnet\Report\Preprocessor\Preprocessor;
class FooPreprocessor extends
{
/**
* @param mixed $data
* @return mixed
*/
public function preprocess($data);
}
Define preprocessors for column referenced by its title.
preprocessors:
<columnTitle>:
- Tlapnet\Report\Preprocessor\Impl\AppendPreprocessor('$')
- Tlapnet\Report\Preprocessor\Impl\PrependPreprocessor('@')
Adds string to start.
preprocessors:
count:
- Tlapnet\Report\Preprocessor\Impl\PrependPreprocessor('@')
Adds string to end.
preprocessors:
count:
- Tlapnet\Report\Preprocessor\Impl\AppendPreprocessor('$')
Displays Yes / No.
preprocessors:
paid:
- Tlapnet\Report\Preprocessor\Impl\BooleanPreprocessor('Yes', 'No')
Formats currency.
preprocessors:
price:
- Tlapnet\Report\Preprocessor\Impl\CurrencyPreprocessor('CZK')
Formats datetime.
preprocessors:
date:
- Tlapnet\Report\Preprocessor\Impl\DatePreprocessor('Y/m/d')
Formats value as email with mailto: link.
preprocessors:
email:
- Tlapnet\Report\Bridges\Nette\Preprocessors\EmailPreprocessor
Shows number in ratio. E.g. 0.3 is shown as 30 / 100
preprocessors:
total:
- Tlapnet\Report\Preprocessor\Impl\MathRatioPreprocessor(100)
Formats number.
preprocessors:
size:
class: Tlapnet\Report\Preprocessor\Impl\NumberPreprocessor
setup:
- setDecimalPoint(',')
- setThousandsPoint('-')
Do nothing.