Magento 2.3 Can't view module's front end page output?
I'm a bit of a noob when it comes to module development for Magento 2, and I need some help: I've started developing a module (for testing purposes) on a localhost installation of Magento 2.3. Now, I think I've done everything right (I created the module.xml, the registration.php, ecc..) and I'm trying to output a simple message on the frontend. This is my code:
routers.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="test" frontName="test">
<module name="Ronk_Test" />
</route>
</router>
test_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Ronk Test Page</title>
</head>
<body>
<referenceContainer name="content">
<block class="RonkTestBlockTest" name="testPage" template="Ronk_Test::test.phtml" />
</referenceContainer>
</body>
test.phtml
echo $block->getTest();
echo __('This is a text.')
- Index.php
namespace RonkTestControllerIndex;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkControllerResultForwardFactory;
use MagentoFrameworkExceptionNotFoundException;
use MagentoFrameworkAppRequestInterface;
/**
* Contact index controller
*/
class Index extends MagentoFrameworkAppActionAction
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
/**
* @var ForwardFactory
*/
protected $resultForwardFactory;
/**
* @var RonkTestHelperData
*/
protected $helper;
/**
* Index constructor.
*
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
* @param RonkTestHelperData $helper
*/
public function __construct(
Context $context,
PageFactory $resultPageFactory,
ForwardFactory $resultForwardFactory,
RonkTestHelperData $helper
) {
$this->resultPageFactory = $resultPageFactory;
$this->resultForwardFactory = $resultForwardFactory;
$this->helper = $helper;
parent::__construct($context);
}
/**
* Dispatch request
*
* @param RequestInterface $request
* @return MagentoFrameworkAppResponseInterface
* @throws MagentoFrameworkExceptionNotFoundException
*/
public function dispatch(RequestInterface $request)
{
if (!$this->helper->isEnabled()) {
throw new NotFoundException(__('Page not found.'));
}
return parent::dispatch($request);
}
/**
* Ronk Test Page
*
* @return MagentoFrameworkViewResultPage
*/
public function execute()
{
/** @var MagentoFrameworkViewResultPage $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->set(__('Ronk Test Page'));
if (!$resultPage) {
$resultForward = $this->resultForwardFactory->create();
return $resultForward->forward('noroute');
}
return $resultPage;
}
}
- Data.php
namespace RonkTestHelper;
/**
* Ronk Test helper
*/
class Data extends MagentoFrameworkAppHelperAbstractHelper
{
/**
* Path to store config if extension is enabled
*
* @var string
*/
const XML_PATH_ENABLED = 'ronk/basic/enabled';
/**
* Check if extension enabled
*
* @return string|null
*/
public function isEnabled()
{
return $this->scopeConfig->isSetFlag(
self::XML_PATH_ENABLED,
MagentoStoreModelScopeInterface::SCOPE_STORE
);
}
}
I followed a guide, of course (being new to this) and I can't seem to understand what am I doing wrong.
Whenever i go to 127.0.0.1/magento23/test/index/index it gives me 404.
Any suggestions?
magento2 module frontend development magento2.3
add a comment |
I'm a bit of a noob when it comes to module development for Magento 2, and I need some help: I've started developing a module (for testing purposes) on a localhost installation of Magento 2.3. Now, I think I've done everything right (I created the module.xml, the registration.php, ecc..) and I'm trying to output a simple message on the frontend. This is my code:
routers.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="test" frontName="test">
<module name="Ronk_Test" />
</route>
</router>
test_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Ronk Test Page</title>
</head>
<body>
<referenceContainer name="content">
<block class="RonkTestBlockTest" name="testPage" template="Ronk_Test::test.phtml" />
</referenceContainer>
</body>
test.phtml
echo $block->getTest();
echo __('This is a text.')
- Index.php
namespace RonkTestControllerIndex;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkControllerResultForwardFactory;
use MagentoFrameworkExceptionNotFoundException;
use MagentoFrameworkAppRequestInterface;
/**
* Contact index controller
*/
class Index extends MagentoFrameworkAppActionAction
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
/**
* @var ForwardFactory
*/
protected $resultForwardFactory;
/**
* @var RonkTestHelperData
*/
protected $helper;
/**
* Index constructor.
*
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
* @param RonkTestHelperData $helper
*/
public function __construct(
Context $context,
PageFactory $resultPageFactory,
ForwardFactory $resultForwardFactory,
RonkTestHelperData $helper
) {
$this->resultPageFactory = $resultPageFactory;
$this->resultForwardFactory = $resultForwardFactory;
$this->helper = $helper;
parent::__construct($context);
}
/**
* Dispatch request
*
* @param RequestInterface $request
* @return MagentoFrameworkAppResponseInterface
* @throws MagentoFrameworkExceptionNotFoundException
*/
public function dispatch(RequestInterface $request)
{
if (!$this->helper->isEnabled()) {
throw new NotFoundException(__('Page not found.'));
}
return parent::dispatch($request);
}
/**
* Ronk Test Page
*
* @return MagentoFrameworkViewResultPage
*/
public function execute()
{
/** @var MagentoFrameworkViewResultPage $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->set(__('Ronk Test Page'));
if (!$resultPage) {
$resultForward = $this->resultForwardFactory->create();
return $resultForward->forward('noroute');
}
return $resultPage;
}
}
- Data.php
namespace RonkTestHelper;
/**
* Ronk Test helper
*/
class Data extends MagentoFrameworkAppHelperAbstractHelper
{
/**
* Path to store config if extension is enabled
*
* @var string
*/
const XML_PATH_ENABLED = 'ronk/basic/enabled';
/**
* Check if extension enabled
*
* @return string|null
*/
public function isEnabled()
{
return $this->scopeConfig->isSetFlag(
self::XML_PATH_ENABLED,
MagentoStoreModelScopeInterface::SCOPE_STORE
);
}
}
I followed a guide, of course (being new to this) and I can't seem to understand what am I doing wrong.
Whenever i go to 127.0.0.1/magento23/test/index/index it gives me 404.
Any suggestions?
magento2 module frontend development magento2.3
1
Did you enable your module?
– Keyur Shah
Dec 20 '18 at 9:53
Yes, Everything is enabled
– Riccardo Ronconi
Dec 20 '18 at 9:56
1
could you please removedispatch(RequestInterface $request)
function fromRonkTestControllerIndex Index
and check? i have suspect that it is returning false
– Keyur Shah
Dec 20 '18 at 9:58
Tried, it still gives me 404 :(
– Riccardo Ronconi
Dec 20 '18 at 10:06
add a comment |
I'm a bit of a noob when it comes to module development for Magento 2, and I need some help: I've started developing a module (for testing purposes) on a localhost installation of Magento 2.3. Now, I think I've done everything right (I created the module.xml, the registration.php, ecc..) and I'm trying to output a simple message on the frontend. This is my code:
routers.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="test" frontName="test">
<module name="Ronk_Test" />
</route>
</router>
test_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Ronk Test Page</title>
</head>
<body>
<referenceContainer name="content">
<block class="RonkTestBlockTest" name="testPage" template="Ronk_Test::test.phtml" />
</referenceContainer>
</body>
test.phtml
echo $block->getTest();
echo __('This is a text.')
- Index.php
namespace RonkTestControllerIndex;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkControllerResultForwardFactory;
use MagentoFrameworkExceptionNotFoundException;
use MagentoFrameworkAppRequestInterface;
/**
* Contact index controller
*/
class Index extends MagentoFrameworkAppActionAction
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
/**
* @var ForwardFactory
*/
protected $resultForwardFactory;
/**
* @var RonkTestHelperData
*/
protected $helper;
/**
* Index constructor.
*
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
* @param RonkTestHelperData $helper
*/
public function __construct(
Context $context,
PageFactory $resultPageFactory,
ForwardFactory $resultForwardFactory,
RonkTestHelperData $helper
) {
$this->resultPageFactory = $resultPageFactory;
$this->resultForwardFactory = $resultForwardFactory;
$this->helper = $helper;
parent::__construct($context);
}
/**
* Dispatch request
*
* @param RequestInterface $request
* @return MagentoFrameworkAppResponseInterface
* @throws MagentoFrameworkExceptionNotFoundException
*/
public function dispatch(RequestInterface $request)
{
if (!$this->helper->isEnabled()) {
throw new NotFoundException(__('Page not found.'));
}
return parent::dispatch($request);
}
/**
* Ronk Test Page
*
* @return MagentoFrameworkViewResultPage
*/
public function execute()
{
/** @var MagentoFrameworkViewResultPage $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->set(__('Ronk Test Page'));
if (!$resultPage) {
$resultForward = $this->resultForwardFactory->create();
return $resultForward->forward('noroute');
}
return $resultPage;
}
}
- Data.php
namespace RonkTestHelper;
/**
* Ronk Test helper
*/
class Data extends MagentoFrameworkAppHelperAbstractHelper
{
/**
* Path to store config if extension is enabled
*
* @var string
*/
const XML_PATH_ENABLED = 'ronk/basic/enabled';
/**
* Check if extension enabled
*
* @return string|null
*/
public function isEnabled()
{
return $this->scopeConfig->isSetFlag(
self::XML_PATH_ENABLED,
MagentoStoreModelScopeInterface::SCOPE_STORE
);
}
}
I followed a guide, of course (being new to this) and I can't seem to understand what am I doing wrong.
Whenever i go to 127.0.0.1/magento23/test/index/index it gives me 404.
Any suggestions?
magento2 module frontend development magento2.3
I'm a bit of a noob when it comes to module development for Magento 2, and I need some help: I've started developing a module (for testing purposes) on a localhost installation of Magento 2.3. Now, I think I've done everything right (I created the module.xml, the registration.php, ecc..) and I'm trying to output a simple message on the frontend. This is my code:
routers.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="test" frontName="test">
<module name="Ronk_Test" />
</route>
</router>
test_index_index.xml
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<title>Ronk Test Page</title>
</head>
<body>
<referenceContainer name="content">
<block class="RonkTestBlockTest" name="testPage" template="Ronk_Test::test.phtml" />
</referenceContainer>
</body>
test.phtml
echo $block->getTest();
echo __('This is a text.')
- Index.php
namespace RonkTestControllerIndex;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkViewResultPageFactory;
use MagentoFrameworkControllerResultForwardFactory;
use MagentoFrameworkExceptionNotFoundException;
use MagentoFrameworkAppRequestInterface;
/**
* Contact index controller
*/
class Index extends MagentoFrameworkAppActionAction
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
/**
* @var ForwardFactory
*/
protected $resultForwardFactory;
/**
* @var RonkTestHelperData
*/
protected $helper;
/**
* Index constructor.
*
* @param MagentoFrameworkAppActionContext $context
* @param MagentoFrameworkViewResultPageFactory $resultPageFactory
* @param MagentoFrameworkControllerResultForwardFactory $resultForwardFactory
* @param RonkTestHelperData $helper
*/
public function __construct(
Context $context,
PageFactory $resultPageFactory,
ForwardFactory $resultForwardFactory,
RonkTestHelperData $helper
) {
$this->resultPageFactory = $resultPageFactory;
$this->resultForwardFactory = $resultForwardFactory;
$this->helper = $helper;
parent::__construct($context);
}
/**
* Dispatch request
*
* @param RequestInterface $request
* @return MagentoFrameworkAppResponseInterface
* @throws MagentoFrameworkExceptionNotFoundException
*/
public function dispatch(RequestInterface $request)
{
if (!$this->helper->isEnabled()) {
throw new NotFoundException(__('Page not found.'));
}
return parent::dispatch($request);
}
/**
* Ronk Test Page
*
* @return MagentoFrameworkViewResultPage
*/
public function execute()
{
/** @var MagentoFrameworkViewResultPage $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->set(__('Ronk Test Page'));
if (!$resultPage) {
$resultForward = $this->resultForwardFactory->create();
return $resultForward->forward('noroute');
}
return $resultPage;
}
}
- Data.php
namespace RonkTestHelper;
/**
* Ronk Test helper
*/
class Data extends MagentoFrameworkAppHelperAbstractHelper
{
/**
* Path to store config if extension is enabled
*
* @var string
*/
const XML_PATH_ENABLED = 'ronk/basic/enabled';
/**
* Check if extension enabled
*
* @return string|null
*/
public function isEnabled()
{
return $this->scopeConfig->isSetFlag(
self::XML_PATH_ENABLED,
MagentoStoreModelScopeInterface::SCOPE_STORE
);
}
}
I followed a guide, of course (being new to this) and I can't seem to understand what am I doing wrong.
Whenever i go to 127.0.0.1/magento23/test/index/index it gives me 404.
Any suggestions?
magento2 module frontend development magento2.3
magento2 module frontend development magento2.3
edited 5 mins ago
Utsav Gupta
15612
15612
asked Dec 20 '18 at 9:46
Riccardo RonconiRiccardo Ronconi
153
153
1
Did you enable your module?
– Keyur Shah
Dec 20 '18 at 9:53
Yes, Everything is enabled
– Riccardo Ronconi
Dec 20 '18 at 9:56
1
could you please removedispatch(RequestInterface $request)
function fromRonkTestControllerIndex Index
and check? i have suspect that it is returning false
– Keyur Shah
Dec 20 '18 at 9:58
Tried, it still gives me 404 :(
– Riccardo Ronconi
Dec 20 '18 at 10:06
add a comment |
1
Did you enable your module?
– Keyur Shah
Dec 20 '18 at 9:53
Yes, Everything is enabled
– Riccardo Ronconi
Dec 20 '18 at 9:56
1
could you please removedispatch(RequestInterface $request)
function fromRonkTestControllerIndex Index
and check? i have suspect that it is returning false
– Keyur Shah
Dec 20 '18 at 9:58
Tried, it still gives me 404 :(
– Riccardo Ronconi
Dec 20 '18 at 10:06
1
1
Did you enable your module?
– Keyur Shah
Dec 20 '18 at 9:53
Did you enable your module?
– Keyur Shah
Dec 20 '18 at 9:53
Yes, Everything is enabled
– Riccardo Ronconi
Dec 20 '18 at 9:56
Yes, Everything is enabled
– Riccardo Ronconi
Dec 20 '18 at 9:56
1
1
could you please remove
dispatch(RequestInterface $request)
function from RonkTestControllerIndex Index
and check? i have suspect that it is returning false– Keyur Shah
Dec 20 '18 at 9:58
could you please remove
dispatch(RequestInterface $request)
function from RonkTestControllerIndex Index
and check? i have suspect that it is returning false– Keyur Shah
Dec 20 '18 at 9:58
Tried, it still gives me 404 :(
– Riccardo Ronconi
Dec 20 '18 at 10:06
Tried, it still gives me 404 :(
– Riccardo Ronconi
Dec 20 '18 at 10:06
add a comment |
2 Answers
2
active
oldest
votes
routes.xml
file must be present in Ronk/Test/etc/frontend
directory. Also make sure the file name is not routers.xml
.
...I'm an idiot... I called it routers. Sorry and thanks a lot, I would never had seen it :(
– Riccardo Ronconi
Dec 20 '18 at 10:53
Is it working now?
– Sufyan Khot
Dec 20 '18 at 10:58
Yes, it's working wonders now, thanks a lot!
– Riccardo Ronconi
Dec 20 '18 at 10:59
happy to know that ;-)
– Sufyan Khot
Dec 20 '18 at 11:54
add a comment |
Not entirely sure whether this is the problem but if you create a reference to your block like so:
$blockObj = $block->getLayout()->createBlock('RonkTestControllerIndexIndex');
and then you can use $blockObj
to access the block methods like $blockObj->getTest()
add a comment |
Your Answer
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f255328%2fmagento-2-3-cant-view-modules-front-end-page-output%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
routes.xml
file must be present in Ronk/Test/etc/frontend
directory. Also make sure the file name is not routers.xml
.
...I'm an idiot... I called it routers. Sorry and thanks a lot, I would never had seen it :(
– Riccardo Ronconi
Dec 20 '18 at 10:53
Is it working now?
– Sufyan Khot
Dec 20 '18 at 10:58
Yes, it's working wonders now, thanks a lot!
– Riccardo Ronconi
Dec 20 '18 at 10:59
happy to know that ;-)
– Sufyan Khot
Dec 20 '18 at 11:54
add a comment |
routes.xml
file must be present in Ronk/Test/etc/frontend
directory. Also make sure the file name is not routers.xml
.
...I'm an idiot... I called it routers. Sorry and thanks a lot, I would never had seen it :(
– Riccardo Ronconi
Dec 20 '18 at 10:53
Is it working now?
– Sufyan Khot
Dec 20 '18 at 10:58
Yes, it's working wonders now, thanks a lot!
– Riccardo Ronconi
Dec 20 '18 at 10:59
happy to know that ;-)
– Sufyan Khot
Dec 20 '18 at 11:54
add a comment |
routes.xml
file must be present in Ronk/Test/etc/frontend
directory. Also make sure the file name is not routers.xml
.
routes.xml
file must be present in Ronk/Test/etc/frontend
directory. Also make sure the file name is not routers.xml
.
answered Dec 20 '18 at 10:30
Sufyan KhotSufyan Khot
899
899
...I'm an idiot... I called it routers. Sorry and thanks a lot, I would never had seen it :(
– Riccardo Ronconi
Dec 20 '18 at 10:53
Is it working now?
– Sufyan Khot
Dec 20 '18 at 10:58
Yes, it's working wonders now, thanks a lot!
– Riccardo Ronconi
Dec 20 '18 at 10:59
happy to know that ;-)
– Sufyan Khot
Dec 20 '18 at 11:54
add a comment |
...I'm an idiot... I called it routers. Sorry and thanks a lot, I would never had seen it :(
– Riccardo Ronconi
Dec 20 '18 at 10:53
Is it working now?
– Sufyan Khot
Dec 20 '18 at 10:58
Yes, it's working wonders now, thanks a lot!
– Riccardo Ronconi
Dec 20 '18 at 10:59
happy to know that ;-)
– Sufyan Khot
Dec 20 '18 at 11:54
...I'm an idiot... I called it routers. Sorry and thanks a lot, I would never had seen it :(
– Riccardo Ronconi
Dec 20 '18 at 10:53
...I'm an idiot... I called it routers. Sorry and thanks a lot, I would never had seen it :(
– Riccardo Ronconi
Dec 20 '18 at 10:53
Is it working now?
– Sufyan Khot
Dec 20 '18 at 10:58
Is it working now?
– Sufyan Khot
Dec 20 '18 at 10:58
Yes, it's working wonders now, thanks a lot!
– Riccardo Ronconi
Dec 20 '18 at 10:59
Yes, it's working wonders now, thanks a lot!
– Riccardo Ronconi
Dec 20 '18 at 10:59
happy to know that ;-)
– Sufyan Khot
Dec 20 '18 at 11:54
happy to know that ;-)
– Sufyan Khot
Dec 20 '18 at 11:54
add a comment |
Not entirely sure whether this is the problem but if you create a reference to your block like so:
$blockObj = $block->getLayout()->createBlock('RonkTestControllerIndexIndex');
and then you can use $blockObj
to access the block methods like $blockObj->getTest()
add a comment |
Not entirely sure whether this is the problem but if you create a reference to your block like so:
$blockObj = $block->getLayout()->createBlock('RonkTestControllerIndexIndex');
and then you can use $blockObj
to access the block methods like $blockObj->getTest()
add a comment |
Not entirely sure whether this is the problem but if you create a reference to your block like so:
$blockObj = $block->getLayout()->createBlock('RonkTestControllerIndexIndex');
and then you can use $blockObj
to access the block methods like $blockObj->getTest()
Not entirely sure whether this is the problem but if you create a reference to your block like so:
$blockObj = $block->getLayout()->createBlock('RonkTestControllerIndexIndex');
and then you can use $blockObj
to access the block methods like $blockObj->getTest()
answered Dec 20 '18 at 9:58
A. FletcherA. Fletcher
246
246
add a comment |
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f255328%2fmagento-2-3-cant-view-modules-front-end-page-output%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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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
1
Did you enable your module?
– Keyur Shah
Dec 20 '18 at 9:53
Yes, Everything is enabled
– Riccardo Ronconi
Dec 20 '18 at 9:56
1
could you please remove
dispatch(RequestInterface $request)
function fromRonkTestControllerIndex Index
and check? i have suspect that it is returning false– Keyur Shah
Dec 20 '18 at 9:58
Tried, it still gives me 404 :(
– Riccardo Ronconi
Dec 20 '18 at 10:06