定制 jokubasr/lithuanian-names-declension 二次开发

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

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

jokubasr/lithuanian-names-declension

Composer 安装命令:

composer require jokubasr/lithuanian-names-declension

包简介

Lithuanian names declension bundle.

README 文档

README

Build Status

The LithuanianNamesDeclensionBundle bundle allows you to inflect Lithuanian names from nominative case to any other.

Installation

Require the jokubasr/lithuanian-names-declension package in your composer.json and update your dependencies.

$ composer require jokubasr/lithuanian-names-declension

Register the bundle in app/AppKernel.php:

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new JokubasR\Bundle\LithuanianNamesDeclensionBundle\JokubasRLithuanianNamesDeclensionBundle(),
    );
}

Usage

You can use declension service either by injecting it or using it in your twig templates.

<?php
use \JokubasR\Bundle\LithuanianNamesDeclensionBundle\Service\Declension;

// ...

/** @var Declension $declension */
$declension = $this->container->get('jokubasr.lithuanian_names_declension.declension');
$inflected = $declension->getInflected("Jokūbas", Declension::CASE_DATIVE);
{{ "Jokūbas"|ablative }}
{{ "Jokūbas"|inflect("ablative") }}
{{ "Jokūbas"|case('ablative') }}

{{ getVocative("Jokūbas") }}
{{ getInflected("Jokūbas") }} {# vocative is the default case #}
{{ getInflected("Jokūbas", "ablative") }}

Available twig filters:

  • inflect- accepts case as a parameter (genitive, dative, accusative, ablative, locative, vocative)
  • case- alias to inflect
  • genitive
  • dative
  • accusative
  • ablative
  • locative
  • vocative

Available twig functions:

  • getInflected - accepts case as a second parameter (genitive, dative, accusative, ablative, locative, vocative)
  • getGenitive
  • getDative
  • getAccusative
  • getAblative
  • getLocative
  • getVocative

Author

Jokūbas Ramanauskas

Original library author

Dainius Kaupaitis, 2011

Contributors

...

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固