/** * Get item class * * @param integer $index Item index * @param integer $length Items list length * @param \XLite\View\FormField\AFormField $field Current item * * @return string */ protected function getItemClass($index, $length, \XLite\View\FormField\AFormField $field) { $classes = preg_grep('/.+/Ss', array_map('trim', explode(' ', $field->getWrapperClass()))); if (0 === $index % 2) { $classes[] = 'even'; } if (1 === $index) { $classes[] = 'first'; } if ($length == $index) { $classes[] = 'last'; } if ($field->getParam(static::SCHEMA_DEPENDENCY)) { $classes[] = 'has-dependency'; } return implode(' ', $classes); }
/** * Register CSS class to use for wrapper block (SPAN) of input field. * It is usable to make unique changes of the field. * * @return string */ public function getWrapperClass() { return trim(parent::getWrapperClass() . ' input-listbox'); }