<?php

$htmlOptions = array(
    "placeholder" => __('SPEED_DIAL_MODEL_'. strtoupper($attribute)),
);

if ($attribute === "key") {
    $htmlOptions["maxlength"] = SpeedDial::SPEED_DIAL_MAX_KEY_LENGTH;
    $htmlOptions["placeholder"] = __('SPEED_DIAL_PREFIX_PHONE_KEY');
}

$inputFiled = CHtml::textField($fieldName, $data->$attribute, $htmlOptions);
$prepand = "";
if ($attribute === "key") {
    $prepand = CHtml::tag(
        'span',
        array(
            'class' => 'add-on',
        ),
        cfg("DP_SPEED_DIAL_ON_PREFIX")
    );
}
        

echo CHtml::tag(
    "div",
    array(
        'class' => $attribute === "key" ? 'input-prepend' : ""
    ),
    $prepand . $inputFiled
);