Magento 2 Route.xml File not working The Next CEO of Stack Overflowmagento 2 captcha not rendering if I override layout xmlI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Magento 2.1: Invoke urlBuilder->getUrl() in a controller in a custom modulemain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?MagentoFrameworkObjectManagerObjectManager givenMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?Magento2 Autoload error
Is the offspring between a demon and a celestial possible? If so what is it called and is it in a book somewhere?
My boss doesn't want me to have a side project
Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico
Creating a script with console commands
It it possible to avoid kiwi.com's automatic online check-in and instead do it manually by yourself?
Could you use a laser beam as a modulated carrier wave for radio signal?
What does this strange code stamp on my passport mean?
How exploitable/balanced is this homebrew spell: Spell Permanency?
Variance of Monte Carlo integration with importance sampling
How to show a landlord what we have in savings?
How can I prove that a state of equilibrium is unstable?
What day is it again?
Simplify trigonometric expression using trigonometric identities
Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?
How can a day be of 24 hours?
Horror film about a man brought out of cryogenic suspension without a soul, around 1990
Which acid/base does a strong base/acid react when added to a buffer solution?
Mathematica command that allows it to read my intentions
Is it OK to decorate a log book cover?
Is it possible to create a QR code using text?
Compilation of a 2d array and a 1d array
How can I separate the number from the unit in argument?
Is it reasonable to ask other researchers to send me their previous grant applications?
Direct Implications Between USA and UK in Event of No-Deal Brexit
Magento 2 Route.xml File not working
The Next CEO of Stack Overflowmagento 2 captcha not rendering if I override layout xmlI created a custom module ,but getting error, not able to figure out what the error is about. How to get out of this error?Magento 2.1: Invoke urlBuilder->getUrl() in a controller in a custom modulemain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?MagentoFrameworkObjectManagerObjectManager givenMagento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 Can't view module's front end page output?Magento2 Autoload error
I created a simple module Wow_Page to create a Hello world page using route.xml with the help of magento 2 devdocs. But when i type the route in the url it is showing 404 error page not found.
My Code is as bellow-
app/code/Wow/Page/registration.php
<?php MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE, 'Wow_Page',
__DIR__
);
app/code/Wow/Page/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
app/code/Wow/Page/etc/frontend/routes.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="learning" frontName="test">
<module name="Wow_Page" />
</route>
</router>
</config>
and finally the controller file
app/code/Wow/Page/Controller/Page/View.php
<?php /**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace WowPageControllerPage;
class View extends MagentoFrameworkAppActionAction
/**
* @var MagentoFrameworkControllerResultJsonFactory
*/
protected $resultJsonFactory;
/**
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory)
$this->resultJsonFactory = $resultJsonFactory;
parent::__construct($context);
/**
* View page action
*
* @return MagentoFrameworkControllerResultInterface
*/
public function execute()
$result = $this->resultJsonFactory->create();
$data = ['message' => 'Hello world!'];
return $result->setData($data);
magento2 magento-2.1 controllers
add a comment |
I created a simple module Wow_Page to create a Hello world page using route.xml with the help of magento 2 devdocs. But when i type the route in the url it is showing 404 error page not found.
My Code is as bellow-
app/code/Wow/Page/registration.php
<?php MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE, 'Wow_Page',
__DIR__
);
app/code/Wow/Page/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
app/code/Wow/Page/etc/frontend/routes.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="learning" frontName="test">
<module name="Wow_Page" />
</route>
</router>
</config>
and finally the controller file
app/code/Wow/Page/Controller/Page/View.php
<?php /**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace WowPageControllerPage;
class View extends MagentoFrameworkAppActionAction
/**
* @var MagentoFrameworkControllerResultJsonFactory
*/
protected $resultJsonFactory;
/**
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory)
$this->resultJsonFactory = $resultJsonFactory;
parent::__construct($context);
/**
* View page action
*
* @return MagentoFrameworkControllerResultInterface
*/
public function execute()
$result = $this->resultJsonFactory->create();
$data = ['message' => 'Hello world!'];
return $result->setData($data);
magento2 magento-2.1 controllers
add a comment |
I created a simple module Wow_Page to create a Hello world page using route.xml with the help of magento 2 devdocs. But when i type the route in the url it is showing 404 error page not found.
My Code is as bellow-
app/code/Wow/Page/registration.php
<?php MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE, 'Wow_Page',
__DIR__
);
app/code/Wow/Page/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
app/code/Wow/Page/etc/frontend/routes.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="learning" frontName="test">
<module name="Wow_Page" />
</route>
</router>
</config>
and finally the controller file
app/code/Wow/Page/Controller/Page/View.php
<?php /**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace WowPageControllerPage;
class View extends MagentoFrameworkAppActionAction
/**
* @var MagentoFrameworkControllerResultJsonFactory
*/
protected $resultJsonFactory;
/**
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory)
$this->resultJsonFactory = $resultJsonFactory;
parent::__construct($context);
/**
* View page action
*
* @return MagentoFrameworkControllerResultInterface
*/
public function execute()
$result = $this->resultJsonFactory->create();
$data = ['message' => 'Hello world!'];
return $result->setData($data);
magento2 magento-2.1 controllers
I created a simple module Wow_Page to create a Hello world page using route.xml with the help of magento 2 devdocs. But when i type the route in the url it is showing 404 error page not found.
My Code is as bellow-
app/code/Wow/Page/registration.php
<?php MagentoFrameworkComponentComponentRegistrar::register(
MagentoFrameworkComponentComponentRegistrar::MODULE, 'Wow_Page',
__DIR__
);
app/code/Wow/Page/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
app/code/Wow/Page/etc/frontend/routes.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved. * See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="learning" frontName="test">
<module name="Wow_Page" />
</route>
</router>
</config>
and finally the controller file
app/code/Wow/Page/Controller/Page/View.php
<?php /**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace WowPageControllerPage;
class View extends MagentoFrameworkAppActionAction
/**
* @var MagentoFrameworkControllerResultJsonFactory
*/
protected $resultJsonFactory;
/**
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkControllerResultJsonFactory $resultJsonFactory
*/
public function __construct(
MagentoFrameworkAppActionContext $context,
MagentoFrameworkControllerResultJsonFactory $resultJsonFactory)
$this->resultJsonFactory = $resultJsonFactory;
parent::__construct($context);
/**
* View page action
*
* @return MagentoFrameworkControllerResultInterface
*/
public function execute()
$result = $this->resultJsonFactory->create();
$data = ['message' => 'Hello world!'];
return $result->setData($data);
magento2 magento-2.1 controllers
magento2 magento-2.1 controllers
edited 2 days ago
Teja Bhagavan Kollepara
3,00841949
3,00841949
asked Oct 29 '18 at 8:00
CrackItCrackIt
5110
5110
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Your module.xml is incorrect
app/code/Wow/Page/etc/module.xml
Your current module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
replace with below code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Wow_Page" setup_version="0.0.1"></module>
</config>
you have added self-module into <sequence></sequence>
, you can't do it into self-module, try it in another module if you need it otherwise leave it.
run below command
php bin/magento setup:upgrade && php bin/magento setup:static-content:deploy -f
you are welcome :)
– Hitesh
Oct 29 '18 at 9:26
add a comment |
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f248219%2fmagento-2-route-xml-file-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your module.xml is incorrect
app/code/Wow/Page/etc/module.xml
Your current module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
replace with below code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Wow_Page" setup_version="0.0.1"></module>
</config>
you have added self-module into <sequence></sequence>
, you can't do it into self-module, try it in another module if you need it otherwise leave it.
run below command
php bin/magento setup:upgrade && php bin/magento setup:static-content:deploy -f
you are welcome :)
– Hitesh
Oct 29 '18 at 9:26
add a comment |
Your module.xml is incorrect
app/code/Wow/Page/etc/module.xml
Your current module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
replace with below code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Wow_Page" setup_version="0.0.1"></module>
</config>
you have added self-module into <sequence></sequence>
, you can't do it into self-module, try it in another module if you need it otherwise leave it.
run below command
php bin/magento setup:upgrade && php bin/magento setup:static-content:deploy -f
you are welcome :)
– Hitesh
Oct 29 '18 at 9:26
add a comment |
Your module.xml is incorrect
app/code/Wow/Page/etc/module.xml
Your current module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
replace with below code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Wow_Page" setup_version="0.0.1"></module>
</config>
you have added self-module into <sequence></sequence>
, you can't do it into self-module, try it in another module if you need it otherwise leave it.
run below command
php bin/magento setup:upgrade && php bin/magento setup:static-content:deploy -f
Your module.xml is incorrect
app/code/Wow/Page/etc/module.xml
Your current module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Learning_FirstUnit" setup_version="0.0.1"> <sequence>
<module name="Wow_Page"/> </sequence>
</module>
</config>
replace with below code
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Wow_Page" setup_version="0.0.1"></module>
</config>
you have added self-module into <sequence></sequence>
, you can't do it into self-module, try it in another module if you need it otherwise leave it.
run below command
php bin/magento setup:upgrade && php bin/magento setup:static-content:deploy -f
edited Oct 29 '18 at 9:25
answered Oct 29 '18 at 8:37
HiteshHitesh
1,2931423
1,2931423
you are welcome :)
– Hitesh
Oct 29 '18 at 9:26
add a comment |
you are welcome :)
– Hitesh
Oct 29 '18 at 9:26
you are welcome :)
– Hitesh
Oct 29 '18 at 9:26
you are welcome :)
– Hitesh
Oct 29 '18 at 9:26
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f248219%2fmagento-2-route-xml-file-not-working%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown