qbbr/locale-configurator-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

qbbr/locale-configurator-bundle

最新稳定版本:1.0.6

Composer 安装命令:

composer require qbbr/locale-configurator-bundle

包简介

Simple configuration on locale

README 文档

README

Simple configuration on locale.

Tests Latest Stable Version Total Downloads License PHP Version Require

Installation

Step 1: Download the Bundle

composer require qbbr/locale-configurator-bundle

Step 2: Enable the Bundle

// config/bundles.php

return [
    // ...
    Qbbr\LocaleConfiguratorBundle\LocaleConfiguratorBundle::class => ['all' => true],
];

Configuration

Config structure

config/locale_configurator/
├── _default.yaml
├── en.yaml
├── ru.yaml
└── ...

logic: config = merge(_default.yaml, locale.yaml)

Parameters by default

u can override it.

parameters:
    qbbr.locale_configurator.config_dir: '%kernel.project_dir%/config/locale_configurator'
    qbbr.locale_configurator.raise_not_found_param_exception: false

Usage

PHP

use Qbbr\LocaleConfiguratorBundle\Configurator\LocaleConfigurator;

class SomeService
{
    private LocaleConfigurator $lc;

    public function __construct(
        LocaleConfigurator $lc
    ) {
        $this->lc = $lc;
    }

    public function something()
    {
        // $this->lc->setLocale('ru');
        $param1 = $this->lc->get('param1');
    }
}

Twig

has lc_has/lc_get fn.

{% if lc_has('param1') %}
    ...
{% endif %}

{% set param1 = lc_get('param1') %}

Tests

./vendor/bin/phpunit Tests/ -v --testdox

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固