Download the PHP package tomchkk/transliterable-bundle without Composer

On this page you can find all versions of the php package tomchkk/transliterable-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package transliterable-bundle

GitHub Release Travis Total Downloads

TransliterableBundle

A Symfony bundle to facilitate the transliteration of Doctrine entity string fields.


Overview

TransliterableBundle provides an embeddable entity, Transliterable, to enable mapping of a single Doctrine entity field to corresponding _original and _transliteration fields.

For example, a Doctrine entity class, Person, with a $firstname property mapped to the Transliterable embedded entity will result in a table with firstname_original and firstname_transliteration columns.


Installation

  1. Require the latest stable version of TransliterableBundle by running the following console command from the root of your Symfony project:

    $ composer require tomchkk/transliterable-bundle

  2. Enable the bundle by adding a reference to it in the array returned by config/bundles.php:

Usage

Embeddable Entity

An entity field can be made transliterable by including a Doctrine Embedded annotation with a class value of the fully-qualified Transliterable class name.

For the same reasons indicated in the documentation for Doctrine Embeddables, Transliterable fields should be initialized to guarantee returning an embedded Transliterable instance - e.g.:

Transliteration

An embbedded Transliterable field with an original value but without a transliteration value will be transliterated when the entity is first persisted, or when updated.

Transliterator

By default TransliterableBundle uses PHP's built-in Transliterator class - decorated with a simple caching mechanism - as the transliteration engine. The default transliterator can be overridden in configuration by a custom service implementing Tomchkk\TransliterableBundle\Service\TransliteratorInterface - e.g.:

Rulesets

In order to perform a transliteration the transliterator requires a ruleset identifier, which is used to create a particular transliterator instance. More on ruleset identifiers.

Global ruleset

The default transliterator provides a ruleset which will be applied to all transliterations if no other ruleset is provided; this default can be overridden by setting the global_ruleset value in configuration - e.g.:

Annotation rulesets

A Transliterable annotation is also available to enable a ruleset to be set at class- or property-level, the most specific of which will be applied to the transliteration of a field's value, overriding the global ruleset.

In the above example $firstname would be transliterated according by the class ruleset; $lastname by the property ruleset.

Frontend

Form Type

A TransliterableType form type is included, providing an original and transliteration field - each extending Symfony's TextType. By default the required option of the transliteration field is set to false since this field, if empty, will be populated when the entity is persisted.

The following configuration options are available for TransliterableType:

Option Type Default Use
exclude_transliteration boolean false Whether or not to exclude the transliteration field in the form
options array [empty] Standard TextType options applicable to both TransliterableType fields
original_options array [empty] Standard TextType options applicable to just the original field
transliteration_options array [empty] Standard TextType options applicable to just the transliteration field

Twig Extension

The transliterate twig filter enables direct transliteration of strings within twig templates - e.g.:

The optional ruleset argument can be used per transliteration, otherwise the Transliterator service's global_ruleset will be used:


All versions of transliterable-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
doctrine/event-manager Version ^1.0
doctrine/orm Version ^2.6
doctrine/persistence Version ^1.1
symfony/config Version ^3.4 || ^4.2
symfony/dependency-injection Version ^3.4 || ^4.2
symfony/form Version ^3.4 || ^4.2
symfony/http-kernel Version ^3.4 || ^4.2
symfony/property-access Version ^3.4 || ^4.2
twig/twig Version ^2.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tomchkk/transliterable-bundle contains the following files

Loading the files please wait ....