Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
- <body>
- <referenceContainer name="content">
- <block class="<vendor><Module>BlockIndex" name="helloworld.index" template="helloworld.phtml" />
- </referenceContainer>
- </body>
- </page>
- <?php
- namespace <vendor><Module>ControllerIndex;
- use MagentoFrameworkAppActionContext;
- class Index extends MagentoFrameworkAppActionAction
- {
- protected $_resultPageFactory;
- public function __construct(Context $context, MagentoFrameworkViewResultPageFactory $resultPageFactory)
- {
- $this->_resultPageFactory = $resultPageFactory;
- parent::__construct($context);
- }
- public function execute()
- {
- $resultPage = $this->_resultPageFactory->create();
- return $resultPage;
- }
- }
- <?php
- namespace <Vendor><Module>Block;
- class Index extends MagentoFrameworkViewElementTemplate
- {
- public function getHelloWorldTxt()
- {
- return 'Hello world!';
- }
- }
- <h1><?php echo $this->getHelloWorldTxt(); ?></h1>
Add Comment
Please, Sign In to add comment