2

The Controller File works fine, die('dasdsa') works. But i am not getting any result on the Backend Page except the Title Change within the Controller.

I Guess it's just something simple :X

Classy/Runrate/Controller/Adminhtml/Index/Index.php

<?php
namespace Classy\Runrate\Controller\Adminhtml\Index;

use Magento\Backend\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;

class Index extends \Magento\Backend\App\Action
{
  protected $resultPageFactory;

  public function __construct(Context $context, PageFactory $resultPageFactory)
  {
    parent::__construct($context);
    $this->resultPageFactory = $resultPageFactory;
  }

  /**
   * Load the page defined in view/adminhtml/layout/runrate_index_index.xml
   *
   */

  public function execute()
  {
    $resultPage = $this->resultPageFactory->create();
    $resultPage->setActiveMenu('Classy_Runrate::runrate');
    $resultPage->getConfig()->getTitle()->prepend(__('Runrate'));

    return $resultPage;
  }
}

Classy/Runrate/view/adminhtml/layout/runrate_index_index.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">
    <update handle="styles"/>
    <body>
      <referenceContainer name="content">
          <block class="Magento\Backend\Block\Template" template="Classy_Runrate::index.phtml"/>
      </referenceContainer>
    </body>
</page>

Classy/Runrate/view/adminhtml/templates/index.phtml

hello world

  • 1
    had a naming issue within my routes to layouts. solved. – Julian Jul 21 '18 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.