定制 cinghie/yii2-multilanguage 二次开发

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

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

cinghie/yii2-multilanguage

最新稳定版本:2.0.2

Composer 安装命令:

composer require cinghie/yii2-multilanguage

包简介

Multi Language support for Yii2 Framework.

README 文档

README

License Latest Stable Version Latest Release Date Latest Commit Total Downloads

Multi Language support for Yii2 Framework based on this post on Official Forum:
http://www.yiiframework.com/forum/index.php/topic/56027-yii2-multilingual-website-url-rules/

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require cinghie/yii2-multilanguage "*"

or add this line to the require section of your composer.json file.

"cinghie/yii2-multilanguage": "*"

Configuration

Set in Configuration File:

// Language Settings
'language'   => 'en',
'sourceLanguage' => 'en_GB',

Make sure you have set the parameter 'language': the default language will be that

Set URL Manager in 'component' Configuration File:

// Url Manager
'urlManager' => [
    'class' => 'codemix\localeurls\UrlManager',
    'languages' => ['en', 'it', 'fr', 'de', 'es'], // List all supported languages here
    'enablePrettyUrl' => true,
    'showScriptName' => false,
],

Images

Copy the img folder from the project root to your web folders to see flag's images

Widgets

You can load the MultiLanguage Widget in the your view like this:

<?= MultiLanguageWidget::widget([
	'addCurrentLang' => true, // add current lang
	'calling_controller' => $this->context,
	'image_type'  => 'classic', // classic or rounded
	'link_home'   => true, // true or false
	'widget_type' => 'classic', // classic or selector
	'width'       => '28'
]); ?>

There are 4 params in the Widget:

  • Widget Type can be classic or selector
  • Image Type can be classic or rounded
  • Width in pixel of the flags
  • The Calling Controller (Do not Edit)

Changelog

  • Version 2.0.2 - Adding options to add current Lang on widgets
  • Version 2.0.1 - Adding Ca, Ch, In, Ne, Ru, Us flags
  • Version 2.0.0 - Refactoring project adding Yii2 Locale URLs: https://github.com/codemix/yii2-localeurls
  • Version 1.2.0 - Minor improvements
  • Version 1.1.2 - Fixing error to extends yii Widget problem
  • Version 1.1.1 - Update Copyright and license
  • Version 1.1.0 - Bug Fixed not home View
  • Version 1.0.0 - Initial Release

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 2
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-01-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固