From 313cf1513f5d6da8d7490e8d0fa85c9f9a590e70 Mon Sep 17 00:00:00 2001 From: "quot;brussens" Date: Tue, 1 Jul 2014 19:01:55 +0400 Subject: [PATCH] Russian translate concept-service-locator.md Added Russian translate docs\guide-ru\concept-service-locator.md --- docs/guide-ru/concept-service-locator.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/guide-ru/concept-service-locator.md b/docs/guide-ru/concept-service-locator.md index 969fd7cb56..69d0aa2567 100644 --- a/docs/guide-ru/concept-service-locator.md +++ b/docs/guide-ru/concept-service-locator.md @@ -24,10 +24,10 @@ use yii\caching\FileCache; $locator = new ServiceLocator; -// register "cache" using a class name that can be used to create a component +// Зарегистрирует "cache", используя имя класса, которое может быть использовано для создания компонента. $locator->set('cache', 'yii\caching\ApcCache'); -// register "db" using a configuration array that can be used to create a component +// Зарегистрирует "db", используя конфигурационный массив, который может быть использован для создания компонента. $locator->set('db', [ 'class' => 'yii\db\Connection', 'dsn' => 'mysql:host=localhost;dbname=demo', @@ -35,12 +35,12 @@ $locator->set('db', [ 'password' => '', ]); -// register "search" using an anonymous function that builds a component +// Зарегистрирует "search", используя анонимную функцию, которая создаёт компонент $locator->set('search', function () { return new app\components\SolrService; }); -// register "pageCache" using a component +// Зарегистрирует "pageCache", используя компонент $locator->set('pageCache', new FileCache); ``` @@ -49,7 +49,7 @@ $locator->set('pageCache', new FileCache); ```php $cache = $locator->get('cache'); -// or alternatively +// или альтернативный $cache = $locator->cache; ```