<?php

use yii\base\Model;
use yii\helpers\Html;

humhub\assets\HumHubColorPickerAsset::register($this);

/* @var $model Model */
/* @var $field string */
/* @var $inputId string */
/* @var $container string */

?>

<?= Html::activeTextInput($model, $field, ['class' => 'form-control', 'id' => $inputId, 'value' => $model->$field, 'style' => 'display:none']); ?>

<script <?= \humhub\libs\Html::nonce() ?>>
    $(function () {
        humhub.modules.ui.colorpicker.apply('#<?= $container ?>', '#<?= $inputId ?>', '<?= $model->$field ?>')
    });
</script>
