使用したHTMLヘルパー
:バーズムが言ったように
<?php echo $this->Html->image('/images/seointro_logo.png', ['alt' => 'logo']); ?>
、あなたはCakePHPが提供するHTMLヘルパーについて確認する必要があります。この中へ
<img src="<?php echo $this->Url->build('/'); ?>images/seointro_logo.png" alt="logo">
<?= $this -> Html -> image('image.png', ['alt' => 'logo']); ?> // img/image.png
<?= $this -> Html -> script('Pages', ['block' => true])?> // js/Pages.js
<?= $this -> Html -> css('pages', ['block' => true]); ?> //css/pages.css
ドントは、あなたのレイアウトファイルでをフェッチそれぞれのを追加し忘れ:
<?= $this -> fetch('css') ?>
<?= $this -> fetch('script') ?>
あなたはdefaulsフォルダの名前を変更した場合、あなたはのconfig/app.php
'App' => [
...
'webroot' => 'webroot',
'imageBaseUrl' => 'img/', //<--- change img/ to yourImagesFolder/
'cssBaseUrl' => 'css/', //<--- change css/ to yourCssFolder/
'jsBaseUrl' => 'js/', //<--- change js/ to yourJsFolder/
....
],
でこれを変更する必要があります公式ドキュメントのブログチュートリアルから始めることで、そのような問題を避けることができます。 http://book.cakephp.org/3.0/ja/tutorials-and-examples.html :)または少なくともHTMLヘルパーについて読むことによって http://book.cakephp.org/3.0/ja/views/helpers /html.html – burzum
これを確認してくださいhttps://sarwarhossain.com/2010/03/16/how-to-cakephp-in-a-sub-directory-access-it-from-root-using-htaccess/ –