1

I have class in my module for Magento 2. His constructor gets 2 parameters

class MyClass
{
    private $str1;
    private $str2;

    public function __construct(string $str1, string str2)
    {
        $this->str1 = $str1;
        $this->str2 = $str2;
    }
}

This parameters saved in database in core_config_data table. I want use this class in other module classes, but i dont know how i can use DI for object transfer of this class in constructors others classes. I can use for this di.xml?

Muhammad Hasham
  • 8,692
  • 11
  • 47
  • 105

0 Answers0