Social Details GithubX Widget

Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads Daily Downloads
Thankful to Krajee!
to get more out of us.

NOTE: This extension depends on the kartik-v/yii2-krajee-base extension which in turn depends on the yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies that may be updated by composer.

The yii2-social module provides access to social plugins and social APIs for Yii Framework 2.0. It includes support for embedding plugins from the following networks into your website:
  • Disqus
  • Facebook
  • Google Plus
  • Google Analytics
  • Twitter
  • VKontakte
  • GitHub

The GithubXPlugin widget is based on unofficial github buttons by @ntkme and supports these parameters.
  • type: string, the Github plugin type to render. These can be one of the following values:

    • GithubXPlugin::WATCH: string, for embedding the Github watch button.

    • GithubXPlugin::STAR: string, for embedding the Github star button.

    • GithubXPlugin::FORK: string, for embedding the Github fork button.

    • GithubXPlugin::ISSUE: string, for embedding the Github issue button.

    • GithubXPlugin::DOWNLOAD: string, for embedding the Github download button.

    • GithubXPlugin::FOLLOW: string, for embedding the Github follow button.

  • user: string, the Github user name.

  • repo: string, the Github repository name.

  • showCount: boolean, whether to show counts for the button if applicable.

  • label: string, the button label to display.

  • settings: array, the configuration options for each github plugin setup as key value pairs. Refer the Github plugin documentation for details on configuring each plugin. The properties supported are:

    • href: string, GitHub link for the button.

    • data-style: string, 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: string, 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.

  • options: array, the HTML attributes for the main plugin. The data api attributes in this array will be automatically set based on the settings configuration.

  • tag: string, the tag of the container rendering the plugin. Defaults to div.

  • noscript: string/boolean, text to be displayed if browser does not support javascript. If set to false will not displayed. Defaults to Please enable JavaScript to view the comments powered by google.

  • noscriptOptions: array, the HTML attributes for the noscript message container. Defaults to ['class' => 'alert alert-danger']

NOTE You can configure the GithubXPlugin settings once at the social module configuration level, for defaulting it across your application, and skip it in your widget calls. For example.
// your module config
'modules' => [
    'social' => [
        // the module class
        'class' => 'kartik\social\Module',

        // the global settings for the github widget
        'githubX' => [
            'settings' => ['user'=>'GITHUB_USER_ID']
        ],
]

// your call in your view/layout file
echo GithubXPlugin::widget(['repo'=>'GITHUB_REPO_ID']); // will use the GitHub settings configured in module

Click one of the Github plugin links below to view details and demo for the plugin