R
R
Roman Savitsky2017-08-29 16:17:04
Yii
Roman Savitsky, 2017-08-29 16:17:04

EasyiiCMS(Yii2) select translations via multilingual?


Good afternoon everyone I connected this add-on: https://github.com/OmgDef/yii2-multilingual-behavior In modules\catalog\models\ Item.php
- I connected the behavior, when creating a record, translations are saved in the database, since in this CMS there are other connections, I can’t, as they say in the manual, replace the find () method in my model, because then errors pop up on the site.
Tell me how to fasten the connection multilingual(), класса MultilingualQueryIn the controller ItemsController
In this action:

public function actionEdit($id)
    {
        if(!($model = Item::findOne($id) )){
            return $this->redirect(['/admin/'.$this->module->id]);
        }

When a record is selected by Id, so that I can display the translations from the database to the admin.
Thank you very much in advance !

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-08-30
@webinar

1. It's worth using a ready-made cms when you write your own. Then you will understand how everything works. If there is no desire to dig deep, then it is better to take something well-documented like wp and not touch the framework. A universal CMS based framework is a dubious thing. For the main meaning and task of the framework is to quickly make cms for the project, and not take the finished one. EasyiiCMS is much worse than wp. Meaning?
2.
I don't understand why you can't do this. I don't see a problem.
3.

In this action:

Why are you trying to implement in the controller what the model should do?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question