public function executeFormatters($field, $column, $formatter_prefix = 'format_', $silent = false)
{
if (is_object($column['type']) && $column['type'] instanceof Closure) {
return $this->current_row[$field] = call_user_func($column['type'], $this->current);
}
$formatters = explode(',', $column['type']);
foreach ($formatters as $formatter) {
if (!$formatter) {
continue;
}
if ($this->hasMethod($m = $formatter_prefix . $formatter)) {
// formatter method is included in this class
$this->{$m}($field, $column);
} elseif (strpos($formatter, '\\') || strpos($formatter, '/')) {
// add-on support:
// http://agiletoolkit.org/codepad/gui/grid#codepad_gui_grid_view_example_7_ex
/** @type Controller_Grid_Format $c */
$c = $this->getElement($formatter . '_' . $field);
$c->formatField($field, $column);
} else {
if (!$silent) {
throw new BaseException('Grid does not know how to format type: ' . $formatter);
}
}
}
}