lithium\template\view\adapter\Simple::_toString()
Renders $data
into an easier to understand, or flat, array.
Parameters
-
array
$data
Data to traverse.
Returns
arraySource
protected function _toString($data) {
foreach ($data as $key => $val) {
switch (true) {
case is_object($val) && !$val instanceof \Closure:
try {
$data[$key] = (string) $val;
} catch (Exception $e) {
$data[$key] = '';
}
break;
case is_array($val):
$data = array_merge($data, Set::flatten($val));
break;
}
}
return $data;
}