定制 yii2mod/yii2-timezone 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yii2mod/yii2-timezone

最新稳定版本:1.0.3

Composer 安装命令:

composer require yii2mod/yii2-timezone

包简介

Timezone helper

README 文档

README

Timezone component for Yii 2

Latest Stable Version Total Downloads License

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yii2mod/yii2-timezone "*"

or add

"yii2mod/yii2-timezone": "*"

to the require section of your composer.json.

Usage

Currently firefox and edge browsers are not supported.

Once the extension is installed, simply add component to your main config file:

    'bootstrap' => [
        'timezone'
    ]
    .....
    'components' => [
        'timezone' => [
            'class' => 'yii2mod\timezone\Timezone',
            'actionRoute' => '/site/timezone' //optional param - full path to page must be specified
        ],
    ]

Then add new action to any controller (SiteController by default)

public function actions()
    {
        return [
            'timezone' => [
                'class' => 'yii2mod\timezone\TimezoneAction',
            ],
        ];
    }

After configuration you can use Yii::$app->timezone->name to get current user's timezone.

统计信息

  • 总下载量: 10.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 14
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-30