2

Copied css, js and relevant file to webroot folder. Then call css and js file to src->Template->Layout->default.php i.e.

<head>
        <?= $this->Html->charset() ?>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>
            <?= $cakeDescription ?>:
            <?= $this->fetch('title') ?>
        </title>
        <?= $this->Html->meta('icon') ?>

        <?= $this->Html->css('base.css') ?>
        <?= $this->Html->css('cake.css') ?>
        
        <?= $this->Html->css('bootstrap.min') ?>
        <?= $this->Html->css('freelancer.min') ?>
        
        <?= $this->Html->script('bootstrap.min') ?>
        <?= $this->Html->script('freelancer.min') ?>
        <?= $this->Html->script('contact_me') ?>
        <?= $this->Html->script('jqBootstrapValidation') ?>

        <?= $this->fetch('meta') ?>
        <?= $this->fetch('css') ?>
        <?= $this->fetch('script') ?>
        
        
        
    </head>

After including these file, css is not working properly. As I am new to here Please somebody guide me the proper way to include the bootstrap template in a cakephp 3 project.

ndm
  • 59,784
  • 9
  • 71
  • 110
  • 1
    `webroot` would be the wrong folder, it should be under `webroot/css/` respectively `webroot/js/`. Please define "_not working properly_", questions that just state "_doesn't work_" tend to not receive any good answers! – ndm Jun 07 '17 at 20:25
  • Note that it might be a good idea to set this up as a new template, so that you'd be putting the files under /plugins/bootstrap4/webroot/css/main.css etc. I did that and am very happy with that approach as it means I can convert the site to the more modern look without breaking all the old stuff.. And it gets it ready for the next rev too. https://book.cakephp.org/3.0/en/views/themes.html – George M Reinstate Monica Jun 08 '17 at 23:59

1 Answers1

0

It's not src->Template->Layout->default.php may be it is src->Template->Layout->default.ctp You have to use Like this format.

<?php echo $this->Html->charset(); ?>
<?= echo $this->Html->charset() ?>
<?= echo $this->Html->meta('icon') ?>

and so on

A.A Noman
  • 5,244
  • 9
  • 24
  • 46