hauntd/yii2-vote

View on GitHub
widgets/Like.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace hauntd\vote\widgets;

use Yii;
use yii\bootstrap\Html;

/**
 * @author Alexander Kononenko <contact@hauntd.me>
 * @package hauntd\vote\widgets
 */
class Like extends VoteToggle
{
    /**
     * @var string
     */
    public $jsCodeKey = 'vote-like';

    /**
     * @return array
     */
    public function getDefaultOptions()
    {
        return array_merge(parent::getDefaultOptions(), [
            'class' => 'vote-toggle vote-toggle-like',
        ]);
    }

    /**
     * @return array
     */
    public function getDefaultButtonOptions()
    {
        return array_merge(parent::getDefaultButtonOptions(), [
            'icon' => Html::icon('glyphicon glyphicon-heart'),
            'label' => Yii::t('vote', 'Like'),
        ]);
    }
}