init
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Stemcell\Catalog\Block\Adminhtml\Stock;
|
||||
|
||||
use Magento\Customer\Block\Adminhtml\Edit\GenericButton;
|
||||
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
|
||||
|
||||
class BackButton extends GenericButton implements ButtonProviderInterface
|
||||
{
|
||||
public function getButtonData()
|
||||
{
|
||||
return [
|
||||
'label' => __('返回'),
|
||||
'class' => 'save primary',
|
||||
'on_click' => sprintf("location.href = '%s';", $this->getSampleUrl()),
|
||||
'sort_order' => 90,
|
||||
];
|
||||
}
|
||||
|
||||
protected function getSampleUrl()
|
||||
{
|
||||
return $this->getUrl('stemcell_catalog/stock/index');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Stemcell\Catalog\Block\Adminhtml\Stock;
|
||||
|
||||
class Import extends \Magento\Backend\Block\Template
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Stemcell\Catalog\Block\Adminhtml\Stock;
|
||||
|
||||
use Magento\Customer\Block\Adminhtml\Edit\GenericButton;
|
||||
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
|
||||
|
||||
class SampleButton extends GenericButton implements ButtonProviderInterface
|
||||
{
|
||||
public function getButtonData()
|
||||
{
|
||||
return [
|
||||
'label' => __('下载模版文件'),
|
||||
'class' => 'save primary',
|
||||
'on_click' => sprintf("location.href = '%s';", $this->getSampleUrl()),
|
||||
'sort_order' => 90,
|
||||
];
|
||||
}
|
||||
|
||||
protected function getSampleUrl()
|
||||
{
|
||||
return $this->getUrl('stemcell_catalog/stock/sample');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Stemcell\Catalog\Block\Adminhtml\Stock;
|
||||
|
||||
use Magento\Customer\Block\Adminhtml\Edit\GenericButton;
|
||||
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
|
||||
|
||||
class SaveButton extends GenericButton implements ButtonProviderInterface
|
||||
{
|
||||
public function getButtonData()
|
||||
{
|
||||
return [
|
||||
'label' => __('导入'),
|
||||
'class' => 'save primary',
|
||||
'data_attribute' => [
|
||||
'mage-init' => ['button' => ['event' => 'save']],
|
||||
'form-role' => 'save',
|
||||
],
|
||||
'sort_order' => 90,
|
||||
];
|
||||
}
|
||||
|
||||
public function getUrl($route = '', $params = [])
|
||||
{
|
||||
return $this->urlBuilder->getUrl('stemcell_catalog/stock/importPost');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user