PHP code example of xj / yii2-ratchet-widget

1. Go to this page and download the library: Download xj/yii2-ratchet-widget library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xj / yii2-ratchet-widget example snippets


RatchetAsset::register($this);

RatchetAndroidAsset::register($this);

RatchetIosAsset::register($this);

echo TabBar::widget([
    'items' => [
        ['label' => '首页', 'url' => ['shop/index'], 'icon' => 'icon icon-home'],
        ['label' => '最新', 'url' => ['shop/hot'], 'icon' => 'icon icon-search'],
        ['label' => '热门', 'url' => ['shop/hot'], 'icon' => 'icon icon-star-filled'],
        ['label' => '没想好', 'url' => ['shop/hot'], 'icon' => 'icon icon-gear'],
        ['label' => '订单', 'url' => ['profile/order'], 'icon' => 'icon icon-person'],
    ]
]);

echo TabBar::widget([
    'items' => [
        ['label' => '首页', 'url' => ['shop/index']],
        ['label' => '最新', 'url' => ['shop/hot']],
        ['label' => '热门', 'url' => ['shop/hot']],
        ['label' => '没想好', 'url' => ['shop/hot']],
        ['label' => '订单', 'url' => ['profile/order']],
    ]
]);