What is the appropriate place to allocate Javascript and CSS libraries in CakePHP 3

2

What is the appropriate place to allocate the Javascript and CSS libraries and plugins in CakePHP 3, since there was a major change in the directory structure of this version to earlier.

All files .js and .css have a specific and separate location.

All calls to files are made this way ():

<?= $this->Html->css('style.css') ?>
<?= $this->Html->script('main.js',['defer' => true]) ?>

It is now possible to notice that there is presumption of the directory where the files are.

Structure of directories (I took prints to see 100% structure and what's inside each one):

OBS: Plugins and Libraries like Jquery, Jquery-ui and Bootstrap have folders and subfolders, font files, icons, images, javascript and css.

    
asked by anonymous 24.07.2015 / 18:24

1 answer

1

You should put in the webroot folder of your application, taking into account that the path pointed to css or js would be declared without webroot

Example:

No html css/default.css points to directory webroot/css/default.css

See the .htaccess code for Cakephp 3 to be more sure:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

link

    
24.07.2015 / 18:50