32 lines
915 B
PHP
32 lines
915 B
PHP
<?php
|
|
|
|
namespace Stemcell\Customer\Controller\Adminhtml\Salesperson;
|
|
|
|
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/salesperson.xlsx';
|
|
$content['type'] = 'filename';
|
|
$content['value'] = $file;
|
|
$content['rm'] = 0;
|
|
return $this->fileFactory->create('salesperson.xlsx', $content);
|
|
}
|
|
}
|