File tree Expand file tree Collapse file tree 2 files changed +27
-11
lines changed
app/code/Magento/UrlRewrite/view/adminhtml Expand file tree Collapse file tree 2 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 13
13
<?php echo $ block ->getChildHtml () ?>
14
14
15
15
<?php if ($ block ->getChildBlock ('form ' )): ?>
16
- <script>
17
- require([
18
- 'jquery',
19
- 'mage/backend/form',
20
- 'mage/backend/validation'
21
- ], function($){
22
-
23
- $('#edit_form').form()
24
- .validation({validationUrl: '<?php /* @escapeNotVerified */ echo $ block ->getValidationUrl () ?> '});
25
-
26
- });
16
+ <script type="text/x-magento-init">
17
+ {
18
+ "#edit_form": {
19
+ "Magento_UrlRewrite/js/url-rewrite-validation" : {
20
+ "url": "<?= $ block ->escapeUrl ($ block ->getValidationUrl ()) ?> "
21
+ }
22
+ }
23
+ }
27
24
</script>
28
25
<?php endif ; ?>
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © Magento, Inc. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+
6
+ define ( [
7
+ 'jquery' ,
8
+ 'mage/backend/form' ,
9
+ 'mage/backend/validation'
10
+ ] , function ( $ ) {
11
+ 'use strict' ;
12
+
13
+ return function ( data , element ) {
14
+
15
+ $ ( element ) . form ( ) . validation ( {
16
+ validationUrl : data . url
17
+ } ) ;
18
+ } ;
19
+ } ) ;
You can’t perform that action at this time.
0 commit comments