PHP Класс kartik\social\GithubXPlugin

Usage: echo GithubXPlugin::widget([ 'type' => GithubPlugin::WATCH, 'user' => 'GITHUB_USER', 'repo' => 'GITHUB_REPO', 'settings' => ['data-style'=>'mega'] ]);
См. также: https://github.com/ntkme/github-buttons
С версии: 1.0
Автор: Kartik Visweswaran ([email protected])
Наследование: extends Widget
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$label the button label to display. If not set it will be autogenerated based on the button type.
$options the HTML attributes for the button
$repo the Github repository name. This is mandatory for all buttons except FOLLOW.
$settings the social plugin settings. The following attributes are recognized: - href: GitHub link for the button. - data-style: controls the size of the button one of default or mega. - data-icon: string, the octicon for the button. It will be autogenerated if not set. All available icons can be found at Octicons. - data-count-href: GitHub link for the count. It defaults to href value (generated from repo and user name). Relative url will be relative to href value. It will be autogenerated if not set. - data-count-api: string, GitHub API endpoint for the count. It will be autogenerated if not set.
$showCount whether to show the count. Defaults to true.
$type the type of button. One of 'watch', 'fork', 'follow'. This is mandatory.
$user the Github user name that owns the repo. This is mandatory.

Защищенные свойства (Protected)

Свойство Тип Описание
$validPlugins the valid plugins

Открытые методы

Метод Описание
getDefaultSetting ( ) : array Gets the default button configurations settings
init ( ) Initialize the widget
renderButton ( ) : string Renders the button
run ( )

Описание методов

getDefaultSetting() публичный Метод

Gets the default button configurations settings
public getDefaultSetting ( ) : array
Результат array

init() публичный Метод

Initialize the widget
public init ( )

renderButton() публичный Метод

Renders the button
public renderButton ( ) : string
Результат string

run() публичный Метод

public run ( )

Описание свойств

$label публичное свойство

the button label to display. If not set it will be autogenerated based on the button type.
public $label

$options публичное свойство

the HTML attributes for the button
public $options

$repo публичное свойство

the Github repository name. This is mandatory for all buttons except FOLLOW.
public $repo

$settings публичное свойство

the social plugin settings. The following attributes are recognized: - href: GitHub link for the button. - data-style: controls the size of the button one of default or mega. - data-icon: string, the octicon for the button. It will be autogenerated if not set. All available icons can be found at Octicons. - data-count-href: GitHub link for the count. It defaults to href value (generated from repo and user name). Relative url will be relative to href value. It will be autogenerated if not set. - data-count-api: string, GitHub API endpoint for the count. It will be autogenerated if not set.
public $settings

$showCount публичное свойство

whether to show the count. Defaults to true.
public $showCount

$type публичное свойство

the type of button. One of 'watch', 'fork', 'follow'. This is mandatory.
public $type

$user публичное свойство

the Github user name that owns the repo. This is mandatory.
public $user

$validPlugins защищенное свойство

the valid plugins
protected $validPlugins