There are two modules - items (goods) and images (images). If the images module is active, then when adding / editing a product, display a field for downloading images (from the images module), if the images module is not active or deleted, then simply display the form for adding / editing goods without a field for loading images. Can you please tell how this can be organized?

  • if (Yii::$app->hasModule('images')){ } - Ninazu
  • Not so not interesting. I want more dynamics / flexibility. - Guest
  • Suppose at the code level you can try to resolve with the help of events, but I don’t understand how to understand it in ideas. - Guest
  • Shove logic into submission. Well, so-so .... You can check in the controller whether the module is connected and, via the renderPartial, render the view from the images and transfer the result as a variable to the view items - Ninazu
  • And who speaks about logic in representations? I just do not know where you can read about this, for example, there is the same items module and seo module, so if the seo module is active / installed, you can add seo fields to the product edit form, save the goods from the seo module, save the seo. At the level of abstraction it seems to be understandable, but as I start writing something in this direction, a lot of questions arise right away. Indeed, ideally, these two modules should not know anything about each other. - Guest

0