2017 © Pedro Peláez
 

yii2-extension yii2-locale

The yii2-locale extension represents the data relevant to a locale such as countries, languages, and orientation.

image

ashrafakl/yii2-locale

The yii2-locale extension represents the data relevant to a locale such as countries, languages, and orientation.

  • Saturday, April 22, 2017
  • by ashrafakl
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

yii2-locale

Locale class represents the data relevant to a locale such as countries, languages, and orientation., (*1)

This class uses and depend on the PHP intl extension., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist ashrafakl/yii2-locale "~1.0.3"

or add, (*5)

"ashrafakl/yii2-locale": "~1.0.3"

to the require section of your composer.json file., (*6)

Usage

Once the extension is installed then add this to your application configuration:, (*7)

<?php
return [
    // ...
    'components' => [
        // ...
        'locale' => [
            'class'=> 'ashrafakl\localization\Locale',
        ],
        // ...
    ]
];

Public properties

Name Description
bundlename Path of ResourceBundle for which to get available locales, or empty string for default locales list http://php.net/manual/en/resourcebundle.locales.php

Public methods

Name Description
getCountries Get Countries list
getCountry Get Country
getRelativePrimaryLanguages Get languages list relative to its locale
getPrimaryLanguages Get languages list
getOrientation Get characters orientation, which is either 'ltr' (left-to-right) or 'rtl' (right-to-left)

Example

To get orientaion use the following code, (*8)

<?= Yii::$app->locale->getOrientation() ?>

The Versions

22/04 2017

dev-master

9999999-dev https://github.com/ashrafakl/yii2-locale

The yii2-locale extension represents the data relevant to a locale such as countries, languages, and orientation.

  Sources   Download

MIT

The Requires

 

extension yii2 locale languages countries orientation characters orientation

22/04 2017

v1.0.3

1.0.3.0 https://github.com/ashrafakl/yii2-locale

The yii2-locale extension represents the data relevant to a locale such as countries, languages, and orientation.

  Sources   Download

MIT

The Requires

 

extension yii2 locale languages countries orientation characters orientation

22/04 2017

v1.0.2

1.0.2.0 https://github.com/ashrafakl/yii2-locale

The yii2-locale extension represents the data relevant to a locale such as countries, languages, and orientation.

  Sources   Download

MIT

The Requires

 

extension yii2 locale languages countries orientation characters orientation

21/04 2017

v1.0.1

1.0.1.0 https://github.com/ashrafakl/yii2-locale

The yii2-locale component represents the data relevant to a locale such as countries.. etc

  Sources   Download

MIT

The Requires

 

extension yii2 locale languages countries

20/04 2017

v1.0.0

1.0.0.0 https://github.com/ashrafakl/yii2-locale

The yii2-locale component represents the data relevant to a locale such as countries.. etc

  Sources   Download

MIT

The Requires

 

extension yii2 locale languages countries