/**
  * จัดรูปแบบการแสดงผลในแต่ละแถว
  *
  * @param array $item
  * @return array
  */
 public function onRow($item)
 {
     foreach ($item as $key => $value) {
         if ($key != 'id') {
             $text = \Kotchasan\Text::toEditor(is_array($value) ? implode(', ', $value) : $value);
             $item[$key] = '<span title="' . $text . '">' . \Kotchasan\Text::cut($text, 50) . '</span>';
         }
     }
     return $item;
 }
Esempio n. 2
0
 /**
  * Generated from @assert ('&"'."'<>{}&amp;&#38;") [==] "&amp;&quot;&#039;&lt;&gt;&#x007B;&#x007D;&amp;&#38;".
  *
  * @covers Kotchasan\Text::toEditor
  */
 public function testToEditor()
 {
     $this->assertEquals("&amp;&quot;&#039;&lt;&gt;&#x007B;&#x007D;&amp;&#38;", \Kotchasan\Text::toEditor('&"' . "'<>{}&amp;&#38;"));
 }