From 73983f4d36e7c53a0530a201a79e6fd8ce288c99 Mon Sep 17 00:00:00 2001 From: stes Date: Thu, 23 Nov 2017 09:42:51 +0200 Subject: [PATCH] class for comment button --- views/artbox_comment_form.php | 6 ++++-- widgets/CommentWidget.php | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/views/artbox_comment_form.php b/views/artbox_comment_form.php index 46b8132..108e3fd 100755 --- a/views/artbox_comment_form.php +++ b/views/artbox_comment_form.php @@ -14,6 +14,7 @@ * @var string $formId * @var View $this * @var RatingModel|NULL $rating_model + * @var string $buttonClass */ $form = ActiveForm::begin( [ @@ -59,9 +60,10 @@ echo Html::tag( 'div', Html::submitButton( - Yii::t('app', 'Submit comment') + Yii::t('app', 'Submit comment'), + (!empty($buttonClass) ? ['class' => $buttonClass] : []) ), - [ 'class' => 'input_bl submit_btn' ] + [ 'class' => 'input_bl submit_btn' ] ); ?> diff --git a/widgets/CommentWidget.php b/widgets/CommentWidget.php index 0c47bd6..c12cd3f 100755 --- a/widgets/CommentWidget.php +++ b/widgets/CommentWidget.php @@ -215,6 +215,12 @@ /** * Initializes the widget params. */ + + /** + * Class for button + * @var string + */ + public $buttonClass = ''; public function init() { // Module init @@ -384,6 +390,7 @@ 'model' => $this->getModel(), 'formId' => $this->formId, 'rating_model' => $ratingModel, + 'buttonClass' => $this->buttonClass ] ), -- libgit2 0.21.4