定制 inspiredminds/contao-remember-language 二次开发

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

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

inspiredminds/contao-remember-language

Composer 安装命令:

composer require inspiredminds/contao-remember-language

包简介

Contao 4 extension to redirect to a language saved in a cookie.

README 文档

README

Contao Remember Language

Contao 4 extension to redirect to a language saved in a cookie when using contao.prepend_locale: true and requesting the domain without any language parameter in the URL.

Configuration

The extension allows you to configure the following:

  • Enable or disable the redirect.
  • Enable or disable saving the current language in a cookie.
  • The name of the cookie.
# Default configuration for extension with alias: "contao_remember_language"
contao_remember_language:

    # Enables the automatic redirect to the saved language.
    enable_redirect:      true

    # Saves the current language as a cookie.
    save_language:        true

    # Name of the cookie where the language is saved.
    cookie_name:          contao_remember_language

Caching

If you use caching, make sure to not add the configured cookie to your COOKIE_ALLOWLIST. The information of the cookie is only relevant for requests to https://example.org/ (without any path/parameter), and since Contao (at least up to Contao 4.9) always redirects such requests (with a status code other than 301) when using contao.prepend_locale: true, such requests are never cached. Thus, it is not necessary to prevent caching when the request contains the cookie.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2018-01-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固