1

We can get individual configuration of magento 2 using:

echo $this->getConfig('xxxx/xxxx');

But is there any way where we can print/show all the configurations which exists in configuration array for magento 2

I have tried as print_r($this->getConfig()); but no result.

1 Answer 1

0

You can try below code I have not try by my own but this need to work

In your block class

protected $config;   
public function __construct(
    ........
    \Magento\Framework\App\Config\Value $config,
    .....
) {
    $this->config = $config;
    parent::__construct($context, $data);
}
public function YourFunction(){
   return  $this->config->getCollection(); //this will return object you can get data using $this->config->getCollection()->getData();
} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.