Commit 73983f4d36e7c53a0530a201a79e6fd8ce288c99
1 parent
295dcf32
class for comment button
Showing
2 changed files
with
11 additions
and
2 deletions
Show diff stats
views/artbox_comment_form.php
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | * @var string $formId |
15 | 15 | * @var View $this |
16 | 16 | * @var RatingModel|NULL $rating_model |
17 | + * @var string $buttonClass | |
17 | 18 | */ |
18 | 19 | $form = ActiveForm::begin( |
19 | 20 | [ |
... | ... | @@ -59,9 +60,10 @@ |
59 | 60 | echo Html::tag( |
60 | 61 | 'div', |
61 | 62 | Html::submitButton( |
62 | - Yii::t('app', 'Submit comment') | |
63 | + Yii::t('app', 'Submit comment'), | |
64 | + (!empty($buttonClass) ? ['class' => $buttonClass] : []) | |
63 | 65 | ), |
64 | - [ 'class' => 'input_bl submit_btn' ] | |
66 | + [ 'class' => 'input_bl submit_btn' ] | |
65 | 67 | ); |
66 | 68 | ?> |
67 | 69 | </div> | ... | ... |
widgets/CommentWidget.php
... | ... | @@ -215,6 +215,12 @@ |
215 | 215 | /** |
216 | 216 | * Initializes the widget params. |
217 | 217 | */ |
218 | + | |
219 | + /** | |
220 | + * Class for button | |
221 | + * @var string | |
222 | + */ | |
223 | + public $buttonClass = ''; | |
218 | 224 | public function init() |
219 | 225 | { |
220 | 226 | // Module init |
... | ... | @@ -384,6 +390,7 @@ |
384 | 390 | 'model' => $this->getModel(), |
385 | 391 | 'formId' => $this->formId, |
386 | 392 | 'rating_model' => $ratingModel, |
393 | + 'buttonClass' => $this->buttonClass | |
387 | 394 | |
388 | 395 | ] |
389 | 396 | ), | ... | ... |