mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 08:17:12 +02:00
Minor refactor of WireArray::__toString() method
This commit is contained in:
@@ -1934,13 +1934,15 @@ class WireArray extends Wire implements \IteratorAggregate, \ArrayAccess, \Count
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function __toString() {
|
public function __toString() {
|
||||||
$s = '';
|
$values = array();
|
||||||
foreach($this as $value) {
|
foreach($this->data as $value) {
|
||||||
if(is_array($value)) $value = "array(" . count($value) . ")";
|
if(is_array($value)) $value = "array(" . count($value) . ")";
|
||||||
$s .= "$value|";
|
$value = (string) $value;
|
||||||
|
if(!strlen($value)) continue;
|
||||||
|
if(strpos($value, '|') !== false) $value = str_replace('|', ' ', $value);
|
||||||
|
$values[] = $value;
|
||||||
}
|
}
|
||||||
$s = rtrim($s, '|');
|
return implode('|', $values);
|
||||||
return $s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user