0

I'm trying to integrate Google Address to magento, following this guide

But I dont understand a line in php, here's the block definition:

namespace Webkul\Autofill\Block;

use Magento\Framework\View\Element\Template\Context;

class Autofillform extends \Magento\Framework\View\Element\Template
{

/**
 * @param Context $context,
 * @param array   $data = []
 */
public function __construct(
    Context $context,
    array $data = []
) {
    parent::__construct($context, $data);
}

/**
 * Return ajax url for button.
 *
 * @return string
 */
public function getGoogleApiKey()
{
    return trim($this->_scopeConfig->getValue('autofill/general_settings/google_api_key'));;
}

}

But in the function getGoogleApiKey I don't understand where _scopeConfig comes from, Is not been set on the __construct function.

Is this guide correct or there's something missing?

Thank you for your time.

2

0

Your Answer

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

Browse other questions tagged or ask your own question.