我创建Magento2了上市和它的正常工作与数据库。 现在我正在努力打造“添加表”了点。
namespace Custom\Module\Controller\Adminhtml\Posts; use Magento\Framework\View\Result\PageFactory; use Magento\Framework\App\Action\Context; class NewAction extends \Magento\Framework\App\Action\Action { /** * @var \Magento\Framework\Controller\Result\ForwardFactory */ protected $resultPageFactory; /** * @param \Magento\Framework\App\Action\Context $context * @param \Magento\Framework\Controller\Result\ForwardFactory $resultForwardFactory */ public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Framework\View\Result\PageFactory $resultPageFactory ) { $this->resultPageFactory = $resultPageFactory; parent::__construct($context); } /** * {@inheritdoc} */ protected function _isAllowed() { return $this->_authorization->isAllowed('Custom_Module::save'); } /** * Forward to edit * * @return \Magento\Backend\Model\View\Result\Forward */ public function execute() { /** @var \Magento\Backend\Model\View\Result\Forward $resultForward */ $resultForward = $this->resultForwardFactory->create(); return $resultForward->forward('edit'); } } 它给下面的错误。 (责任编辑:好模板) |