| Current Path : /home/rtorresani/www/app/code/Webkul/BuyButton/Model/ |
| Current File : //home/rtorresani/www/app/code/Webkul/BuyButton/Model/InitializeJs.php |
<?php
/**
* Webkul Software.
*
* @category Webkul
* @package Webkul_BuyButton
* @author Webkul
* @copyright Copyright (c) Webkul Software Private Limited (https://webkul.com)
* @license https://store.webkul.com/license.html
*/
namespace Webkul\BuyButton\Model;
class InitializeJs
{
/**
* Undocumented function
*
* @param \Magento\Framework\Filesystem\Driver\File$driverInterface
*/
public function __construct(
\Magento\Framework\Filesystem\Driver\File $driverInterface
) {
$this->driverInterface = $driverInterface;
}
public function load()
{
$objectManager = self::getObjectManager();
$viewUrl = $objectManager->viewUrl();
$js = $viewUrl.'init.js';
return $this->driverInterface->fileGetContents($js);
}
public function getObjectManager()
{
return \Magento\Framework\App\ObjectManager::getInstance()->get(\Webkul\BuyButton\Model\ObjectProvider::class);
}
}