Hm, im Template kommt tatsächlich immer nur der kombinierte String mit allen Klassen an.
Ich komm grad auf keine elegantere Lösung, probier mal so im Template (form_textfield):
PHP-Code:
<?php $this->extend('form_row'); ?>
<?php
$innerClass = $this->class;
$objFormfieldModel = \FormFieldModel::findByPk($this->strId);
$customClass = $objFormfieldModel->class;
if ($innerClass && $customClass)
{
$innerClass = str_replace($customClass, '', $innerClass);
}
?>
<?php $this->block('label'); ?>
<?php if ($this->label): ?>
<label for="ctrl_<?= $this->id ?>"<?php if ($this->class): ?> class="<?= $innerClass ?>"<?php endif; ?>>
<?php if ($this->mandatory): ?>
<span class="invisible"><?= $this->mandatoryField ?> </span><?= $this->label ?><span class="mandatory">*</span>
<?php else: ?>
<?= $this->label ?>
<?php endif; ?>
</label>
<?php endif; ?>
<?php $this->endblock(); ?>
<?php $this->block('field'); ?>
<!-- <?=$customClass?> -->
<?php if ($this->hasErrors()): ?>
<p class="error"><?= $this->getErrorAsString() ?></p>
<?php endif; ?>
<input type="<?= $this->type ?>" name="<?= $this->name ?>" id="ctrl_<?= $this->id ?>" class="text<?php if ($this->hideInput) echo ' password'; ?><?php if ($innerClass) echo ' ' . $innerClass; ?>" value="<?= specialchars($this->value) ?>"<?= $this->getAttributes() ?>>
<?php if ($this->addSubmit): ?>
<input type="submit" id="ctrl_<?= $this->id ?>_submit" class="submit" value="<?= $this->slabel ?>">
<?php endif; ?>
<?php $this->endblock(); ?>
Lesezeichen