定制 ashrafakl/yii2-locale 二次开发

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

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

ashrafakl/yii2-locale

最新稳定版本:v1.0.3

Composer 安装命令:

composer require ashrafakl/yii2-locale

包简介

The yii2-locale extension represents the data relevant to a locale such as countries, languages, and orientation.

README 文档

README

Locale class represents the data relevant to a locale such as countries, languages, and orientation.

This class uses and depend on the PHP intl extension.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist ashrafakl/yii2-locale "~1.0.3"

or add

"ashrafakl/yii2-locale": "~1.0.3"

to the require section of your composer.json file.

Usage

Once the extension is installed then add this to your application configuration:

<?php
return [
    // ...
    'components' => [
        // ...
        'locale' => [
            'class'=> 'ashrafakl\localization\Locale',
        ],
        // ...
    ]
];

Public properties

Name Description
bundlename Path of ResourceBundle for which to get available locales, or empty string for default locales list http://php.net/manual/en/resourcebundle.locales.php

Public methods

Name Description
getCountries Get Countries list
getCountry Get Country
getRelativePrimaryLanguages Get languages list relative to its locale
getPrimaryLanguages Get languages list
getOrientation Get characters orientation, which is either 'ltr' (left-to-right) or 'rtl' (right-to-left)

Example

To get orientaion use the following code

<?= Yii::$app->locale->getOrientation() ?>

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固