File tree Expand file tree Collapse file tree 2 files changed +27
-9
lines changed
app/code/Magento/UrlRewrite/view/adminhtml Expand file tree Collapse file tree 2 files changed +27
-9
lines changed Original file line number Diff line number Diff line change 10
10
?>
11
11
<?= $ block ->getChildHtml () ?>
12
12
<?php if ($ block ->getChildBlock ('form ' )): ?>
13
- <script>
14
- require([
15
- 'jquery',
16
- 'mage/backend/form',
17
- 'mage/backend/validation'
18
- ], function($){
19
- $('#edit_form').form()
20
- .validation({validationUrl: '<?= $ block ->escapeUrl ($ block ->getValidationUrl ()) ?> '});
21
- });
13
+ <script type="text/x-magento-init">
14
+ {
15
+ "#edit_form": {
16
+ "Magento_UrlRewrite/js/url-rewrite-validation" : {
17
+ "url": "<?= $ block ->escapeUrl ($ block ->getValidationUrl ()) ?> "
18
+ }
19
+ }
20
+ }
22
21
</script>
23
22
<?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