承接 kunstmaan/languagechooser-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kunstmaan/languagechooser-bundle

Composer 安装命令:

composer require kunstmaan/languagechooser-bundle

包简介

The Kunstmaan Language chooser bundle supplies your project with basic but extendible language chooser

README 文档

README

Build Status Total Downloads Latest Stable Version Analytics

Handles autodetection of the language of the end user or shows a splash page with a language choice.

Installation instructions

Assuming you have installed composer.phar or composer binary:

$ composer require kunstmaan/languagechooser-bundle dev-master

Add the KunstmaanLanguageChooserBundle and the LuneticsLocaleBundle to your AppKernel.php file:

new Kunstmaan\LanguageChooserBundle\KunstmaanLanguageChooserBundle(),
new Lunetics\LocaleBundle\LuneticsLocaleBundle(),

Remark: The KunstmaanLanguageChooserBundle should be loaded BEFORE the LuneticsLocaleBundle

Add the KunstmaanLanguageChooserBundle to your routing.yml:

# KunstmaanLanguageChooserBundle
_languagechooser:
    resource: .

Overwrite the KunstmaanLanguageChooserBundle config to your needs in config.yml:

kunstmaan_language_chooser:
    autodetectlanguage: false
    showlanguagechooser: true
    languagechoosertemplate: CompanyYourBundle:Default:language-chooser.html.twig
    languagechooserlocales: [en, nl, fr]

Usage

When the user arrives on the root page of your website (eg. http://domain.com/) he:

  • is automatically redirect to his language of choice (eg. http://domain.com/en) when the autodetectlanguage is set to true
  • sees a splash page where he can select his language manually when the showlanguagechooser is set to true

The template path of the splash page can we set via the languagechoosertemplate configuration parameter.

In all your Twig templates, there is a global variable available with an array of the available languages: languagechooser_languages. This can be usefull on your custom splash page, or when you want to show the language choice on other pages.

<ul>
    {% for lang in languagechooser_languages %}
        <li>{{ lang }}</li>
    {% endfor %}
</ul>

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 37
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-04-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固