# Morphos

Для склонения названия городов используется библиотека [Morphos](https://github.com/wapmorgan/Morphos), а именно часть Geographical names (Страны/Города) (Russian)

Использование его в своей логике макете или ТДС

{% code fullWidth="true" %}

```php
Morphos_Geographical::getCase('Екатеринбург', 'предложный'); // Екатеринбурге
```

{% endcode %}

Добавление в XML всех склонений определенного города, например в контроллер Shop\_Controller\_Show

{% code fullWidth="true" %}

```php
$aCases = array(
    'именительный', // Екатеринбург
    'родительный', // Екатеринбурга
    'дательный', // Екатеринбургу
    'винительный', // Екатеринбург
    'творительный', // Екатеринбургом
    'предложный', // Екатеринбурге
);

$value = 'Екатеринбург';

foreach($aCases as $case)
{
    $Shop_Controller_Show
        ->addEntity(
            Core::factory('Core_Xml_Entity')
                ->name('morphos')
                ->addAttribute('case', $case)
                ->value(Morphos_Geographical::getCase($value, $case));
        );
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.morozovpimnev.ru/multiregion/morphos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
