cakephp3 metaタグ linkタグ スラッシュ削除
・headタグ内
1 2 3 | <?= $this ->Html->meta([ 'http-equiv' => 'X-UA-Compatible' , 'content' => 'IE=edge' ]). "\n" ?> <?= $this ->Html->meta([ 'name' => 'viewport' , 'content' => 'width=device-width, initial-scale=1.0' ]). "\n" ?> <?= $this ->Html->css( 'base.css' ). "\n" ?> |
・output
1 2 3 | <meta http-equiv= "X-UA-Compatible" content= "IE=edge" /> <meta name= "viewport" content= "width=device-width, initial-scale=1.0" /> <link rel= "stylesheet" href= "/zenkokujiin/css/base.css" /> |
・編集するファイル
\vendor\cakephp\cakephp\src\View\Helper\HtmlHelper.php
1 2 3 4 5 6 7 | 'meta' => '<meta{{attrs}}/>' , 'css' => '<link rel="{{rel}}" href="{{url}}"{{attrs}}/>' , ↓「/」削除 'meta' => '<meta{{attrs}}>' , 'css' => '<link rel="{{rel}}" href="{{url}}"{{attrs}}>' , |
・output
1 2 3 | <meta http-equiv= "X-UA-Compatible" content= "IE=edge" > <meta name= "viewport" content= "width=device-width, initial-scale=1.0" > <link rel= "stylesheet" href= "/zenkokujiin/css/base.css" > |