I have a block within a phtml file: the block is not associated with a controller.
echo $this->getLayout() ->createBlock("Top\CmsAndTemplatePages\Block\Cmspages") ->setTemplate("Top_CmsAndTemplatePages::categoryPages/rootblock.phtml") ->toHtml();
my question now is how do i call the methods of the block.
i.e within the class
Top-> CmsAndTemplatePages->Block->Cmspages is a method called
how do i access this method from the phtml page