How do you debug a page in a custom module. or more to the point. How do you debug whether the xml is rending the correct page content.
I am trying to create a page in my custom module, I am able to create the page but its content is blank.
I believe that the problem relates to the xml because if I do a vardump
on the controller it renders an output. this means that the problem relates to the xml output.
below are my files-- I would really appriate any advice on how I can go out debugging the problem.
=> Block :
namespace Lsg\Authunpw\Block;
class PostList extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
array $data = []
) {
parent::__construct($context, $data);
// $this->_postCollectionFactory = $postCollectionFactory;
}
public function getIdentities()
{
return [\Lsg\Authunpw\Model\Customer::CACHE_TAG . '_' . 'list'];
}
}
Fronend xml :
Lsg\Authunpw\etc\frontend\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="standard">
<route id="auths" frontName="auths">
<module name="Lsg_Authunpw" />
</route>
</router>
</config>
Frontend view :
authunpw_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Lsg\Authunpw\Block\PostList" name="auths.list" template="Lsg_Authunpw::list.phtml" />
</referenceContainer>
</body>
</page>