S
S
sdgs4s4 .2017-10-19 19:20:11
Yii
sdgs4s4 ., 2017-10-19 19:20:11

Yii2 - translate product names into url?

Hello!
I searched a lot of places for information on the transliteration of the product name and its substitution in the product URL, but did not find it. Maybe there is some literature in Russian?
All that we managed to find is the CNC url and that's it, then it feels like no one needs it and it will be enough if the product url contains only its id
Help with the search!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Fedorov, 2017-10-19
@Encoderast

Options:

  • Make via inflector in Yii2
  • Through behavior (you can set which fields to substitute in transliteration)
    https://github.com/zelenin/yii2-slug-behavior

A
Andrey Markov, 2017-10-20
@DmitriyFrolov

\yii\helpers\Inflector::slug('product name',' '-');
//name-product

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question