1

I created a module with following admin routes.xml

/app/code/UV/Bestellung/etc/adminhtml/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="custom" frontName="custom">
            <module name="UV_Bestellung" />
        </route>
    </router>
</config>

This is the controller:

app/code/UV/Bestellung/Adminhtml/Controller/Index

<?php
namespace UV\Bestellung\Controller\Adminhtml\Index;

use Magento\Framework\App\Action\Action;
use Magento\Framework\Controller\ResultFactory;

class Index extends Action
{
    public function execute()
    {
        echo 'Test';
        /*
        $page = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
        return $page;
        */
    }
}

When I call

www.mysite.com/admin/custom

it redirects me to the Dashboard. Can someone tell me what is wrong or what the correct URL is?

Thanks! :-)

  • @kiran kumar Your edits are confusing: they seem to be editing the solution into the question, but that makes the answer not make sense. The way this site works is that the question should remain a description of the problem, and the answer to that problem should appear below it. – IMSoP Mar 22 '18 at 13:26
3

Replace

namespace UV\Bestellung\Adminhtml\Controller\Index;

with

namespace UV\Bestellung\Controller\Adminhtml\Index;
  • kese kar lete ho ye sab????? talent ha baki.... :D – Ronak Chauhan Mar 22 '18 at 12:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.