私はmagento 2でカスタムモジュールを作成しています.phtmlファイルでブロック関数を呼び出したいです。しかし、それは機能していません。私を助けてください。
これがadminhtmlフォルダーファイルの私のブロックです。
namespace Question\Topic\Block\Adminhtml;
class Topic extends  \Magento\Framework\View\Element\Template {
    public function getSample() {
             return "abhishek";
    }
}
そして、view/adminhtml/layout の topic_order_view.xml ファイルは
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="view" template="Questions_Topic::view.phtml" />
        </referenceContainer>
    </body>
</page>
これがController/Adminhtml/Order/view.phpの私のコントローラーです---
namespace Question\Topic\Controller\Adminhtml\Order;
use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\App\Config\ScopeConfigInterface;
class View extends \Magento\Backend\App\Action
{
    /**
     * @var PageFactory
     */
     protected $resultPageFactory;
    /**
     * @var scopeConfig
     * Needed to retrieve config values
     */
    protected $scopeConfig;
   public function __construct(
        Context $context,
        PageFactory $resultPageFactory,
        ScopeConfigInterface $scopeConfig // Needed to retrieve config values
    ) {
        parent::__construct($context);
        $this->resultPageFactory = $resultPageFactory;
        $this->scopeConfig = $scopeConfig; // Needed to retrieve config values
    }
      public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->getConfig()->getTitle()->prepend(__('Orders')); // 
         return $resultPage;
    }
}
view/adminhtml/templates/order/view.phtml の私の view.phtml ファイル
<?php
//echo $this->getSample();
echo $block->getSample();
?>
<h1>Hello </h1>
Helloワードを表示しています。ただし、上記のブロック コードはエコーしません
前もって感謝します..