Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
form.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
9 ?>
10 <form class="form contact"
11  action="<?= $block->escapeUrl($block->getFormAction()) ?>"
12  id="contact-form"
13  method="post"
14  data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>"
15  data-mage-init='{"validation":{}}'>
16  <fieldset class="fieldset">
17  <legend class="legend"><span><?= $block->escapeHtml(__('Write Us')) ?></span></legend><br />
18  <div class="field note no-label"><?= $block->escapeHtml(__('Jot us a note and we’ll get back to you as quickly as possible.')) ?></div>
19  <div class="field name required">
20  <label class="label" for="name"><span><?= $block->escapeHtml(__('Name')) ?></span></label>
21  <div class="control">
22  <input name="name" id="name" title="<?= $block->escapeHtmlAttr(__('Name')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('name') ?: $this->helper('Magento\Contact\Helper\Data')->getUserName()) ?>" class="input-text" type="text" data-validate="{required:true}"/>
23  </div>
24  </div>
25  <div class="field email required">
26  <label class="label" for="email"><span><?= $block->escapeHtml(__('Email')) ?></span></label>
27  <div class="control">
28  <input name="email" id="email" title="<?= $block->escapeHtmlAttr(__('Email')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('email') ?: $this->helper('Magento\Contact\Helper\Data')->getUserEmail()) ?>" class="input-text" type="email" data-validate="{required:true, 'validate-email':true}"/>
29  </div>
30  </div>
31  <div class="field telephone">
32  <label class="label" for="telephone"><span><?= $block->escapeHtml(__('Phone Number')) ?></span></label>
33  <div class="control">
34  <input name="telephone" id="telephone" title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>" value="<?= $block->escapeHtmlAttr($this->helper('Magento\Contact\Helper\Data')->getPostValue('telephone')) ?>" class="input-text" type="text" />
35  </div>
36  </div>
37  <div class="field comment required">
38  <label class="label" for="comment"><span><?= $block->escapeHtml(__('What’s on your mind?')) ?></span></label>
39  <div class="control">
40  <textarea name="comment" id="comment" title="<?= $block->escapeHtmlAttr(__('What’s on your mind?')) ?>" class="input-text" cols="5" rows="3" data-validate="{required:true}"><?= $block->escapeHtml($this->helper('Magento\Contact\Helper\Data')->getPostValue('comment')) ?></textarea>
41  </div>
42  </div>
43  <?= $block->getChildHtml('form.additional.info') ?>
44  </fieldset>
45  <div class="actions-toolbar">
46  <div class="primary">
47  <input type="hidden" name="hideit" id="hideit" value="" />
48  <button type="submit" title="<?= $block->escapeHtmlAttr(__('Submit')) ?>" class="action submit primary">
49  <span><?= $block->escapeHtml(__('Submit')) ?></span>
50  </button>
51  </div>
52  </div>
53 </form>
$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
if( $form)() ?>< script > require(['jquery' mage mage
Definition: save.phtml:15
__()
Definition: __.php:13
jquery extjs ext tree mage adminhtml form
Definition: tree.phtml:41
$block
Definition: block.php:8