Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
serializer.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php
14 ?>
15 <?php $_id = 'id_' . md5(microtime()) ?>
16 <?php $formId = $block->getFormId()?>
17 <?php if (!empty($formId)) :?>
18 <script>
19  require([
20  'prototype',
21  'mage/adminhtml/grid'
22  ], function(){
23  Event.observe(window, "load", function(){
24  var serializeInput = document.createElement('input');
25  serializeInput.type = 'hidden';
26  serializeInput.name = '<?= /* @escapeNotVerified */ $block->getInputElementName() ?>';
27  serializeInput.id = '<?= /* @escapeNotVerified */ $_id ?>';
28  try {
29  document.getElementById('<?= /* @escapeNotVerified */ $formId ?>').appendChild(serializeInput);
30  new serializerController('<?= /* @escapeNotVerified */ $_id ?>', <?= /* @escapeNotVerified */ $block->getDataAsJSON() ?>, <?= /* @escapeNotVerified */ $block->getColumnInputNames(true) ?>, <?= /* @escapeNotVerified */ $block->getGridBlock()->getJsObjectName() ?>, '<?= /* @escapeNotVerified */ $block->getReloadParamName() ?>');
31  } catch(e) {
32  //Error add serializer
33  }
34  });
35  });
36 </script>
37 <?php else :?>
38 <input type="hidden" name="<?= /* @escapeNotVerified */ $block->getInputElementName() ?>" value="" id="<?= /* @escapeNotVerified */ $_id ?>" />
39 <script>
40  require([
41  'mage/adminhtml/grid'
42  ], function(){
43  new serializerController('<?= /* @escapeNotVerified */ $_id ?>', <?= /* @escapeNotVerified */ $block->getDataAsJSON() ?>, <?= /* @escapeNotVerified */ $block->getColumnInputNames(true) ?>, <?= /* @escapeNotVerified */ $block->getGridBlock()->getJsObjectName() ?>, '<?= /* @escapeNotVerified */ $block->getReloadParamName() ?>');
44  });
45 </script>
46 <?php endif;?>
$block setTitle( 'CMS Block Title') -> setIdentifier('fixture_block') ->setContent('< h1 >Fixture Block Title</h1 >< a href=" store url</a><p> Config value
Definition: block.php:9
$block
Definition: block.php:8
if(file_exists($vendorAutoload)) else
Definition: autoload.php:31
endif