cancel
Showing results for 
Search instead for 
Did you mean: 

No content display for an admin module

No content display for an admin module

I have this display

 

4hbRh.jpg

 

in my module. I have the title but not the content. My php is :

in app/code/Gelorna/Intelligentimporter/Controller/Adminhtml/Concurrents/Index.php (it works because a can play with the title external catalogs):

 

namespace Gelorna\Intelligentimporter\Controller\Adminhtml\Concurrents;

class Index extends \Magento\Backend\App\Action
{   
    protected $ADMIN_RESOURCE = 'Gelorna_Intelligentimporter::concurrents';

    protected $resultPageFactory;

    /**
     * @param Context $context
     * @param PageFactory $resultPageFactory
     */
    public function __construct(
        \Magento\Backend\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    //présentation de la iframe
    public function execute()
    {
        $resultPage = $this->resultPageFactory->create();
        $resultPage->setActiveMenu($this->ADMIN_RESOURCE);
        $resultPage->getConfig()->getTitle()->prepend(__('External catalogs'));


        return $resultPage;
    } 

in app/code/Gelorna/Intelligentimporter/view/adminhtml/layout/intelligentimporter_concurrents_index.xml :

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Gelorna\Intelligentimporter\Block\Concurrents" name="intelligentimporter_concurrents" template="Gelorna_Intelligentimporter::concurrents.phtml">
                <arguments>
                    <argument name="block_id" xsi:type="string">example</argument>
                </arguments>
            </block>
            <!--<uiComponent name="intelligentimporter_concurrents_contenu"/>-->
        </referenceContainer>
    </body>
</page>

in app/code/Gelorna/Intelligentimporter/view/adminhtml/templates/concurrents.phtml:

<h1>aaa</h1>

As you can see the text "aaa" is not displayed and I do not understand why. Can you help me ?

app/code/Gelorna/Intelligentimporter/Block/Concurrents.php :

<?php

namespace Gelorna\Intelligentimporter\Block;


class Concurrents extends \Magento\Framework\View\Element\Template
{
    public function __construct(\Magento\Framework\View\Element\Template\Context $context)
    {
        parent::__construct($context);
    }

    public function getTitle()
    {
        return __('Manage external catalogs');
    }

    public function _toHtml()
    {
        return 'Today\'s date is ' . date('Y-m-d');
    }
}