protected addClasses ( array &$arrSource ) : void | ||
$arrSource | array | The array reference of the array to which the classes shall be added to. |
리턴 | void |
protected function addClasses(&$arrSource)
{
$countFiles = count($arrSource);
foreach (array_keys($arrSource) as $k) {
$arrSource[$k]['class'] = ($k == 0 ? ' first' : '') . ($k == $countFiles - 1 ? ' last' : '') . ($k % 2 == 0 ? ' even' : ' odd');
}
}