init
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Stemcell\Customer\Controller\Adminhtml\Lab;
|
||||
|
||||
use Magento\Framework\App\Action\HttpGetActionInterface;
|
||||
|
||||
class Sample implements HttpGetActionInterface
|
||||
{
|
||||
protected \Magento\Framework\App\Response\Http\FileFactory $fileFactory;
|
||||
private \Magento\Framework\Module\Dir $moduleDir;
|
||||
|
||||
public function __construct(
|
||||
\Magento\Framework\App\Response\Http\FileFactory $fileFactory,
|
||||
\Magento\Framework\Module\Dir $moduleDir
|
||||
) {
|
||||
$this->fileFactory = $fileFactory;
|
||||
$this->moduleDir = $moduleDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$file = $this->moduleDir->getDir('Stemcell_Customer').'/data/Sample.xlsx';
|
||||
$content['type'] = 'filename';
|
||||
$content['value'] = $file;
|
||||
$content['rm'] = 0;
|
||||
return $this->fileFactory->create('Sample.xlsx', $content);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user