jokubasr/lithuanian-names-declension
最新稳定版本:v1.1
Composer 安装命令:
composer require jokubasr/lithuanian-names-declension
包简介
Lithuanian names declension bundle.
README 文档
README
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
...
统计信息
- 总下载量: 13.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-04