KaueDrey

Untitled

Dec 3rd, 2020 (edited)
883
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- app/code/Smarty/Zarpoo/view/frontend/layout/cms_index_index.xml -->
  2. <?xml version="1.0"?>
  3. <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  4.     <body>
  5.         <referenceContainer name="content">
  6.             <block class="Magento\Framework\View\Element\Template" template="Smarty_Zarpoo::index.phtml"/>
  7.         </referenceContainer>
  8.     </body>
  9. </page>
  10.  
  11. <!-- app/code/Smarty/Zarpoo/view/frontend/templates/index.phtml -->
  12. <div id="m2-component" data-bind="scope:'m2kocomponent'">
  13.     <!-- ko template: getTemplate() --><!-- /ko -->
  14.     <script type="text/x-magento-init">
  15.     {
  16.         "#m2-component": {
  17.             "Magento_Ui/js/core/app": {
  18.                "components": {
  19.                     "m2kocomponent": {
  20.                         "component": "Smarty_Zarpoo/js/uicomponentjs",
  21.                         "template" : "Smarty_Zarpoo/m2kocomponent-template",
  22.                         "modulename ": "<?= $block->escapeJs($block->getModuleName()); ?>"
  23.                     }
  24.                 }
  25.             }
  26.         }
  27.     }
  28.     </script>
  29. </div>
  30.  
  31. <!-- app/code/Smarty/Zarpoo/view/frontend/web/js/uicomponentjs.js -->
  32. define([
  33.     'jquery',
  34.     'uiComponent',
  35.     'Magento_Customer/js/model/authentication-popup'
  36. ], function ($, Component, popup) {
  37.     'use strict';
  38.  
  39.     popup.createPopUp($(‘#authenticationPopup’));
  40. popup.showModal();
  41.  
  42.     return Component.extend({
  43.         initialize: function () {
  44.             this._super();
  45.             <!-- popup.showModal(); -->
  46.         }
  47.     });
  48. }
  49. );
RAW Paste Data