Imported CakePHP jr file src tag missing

I am trying to do something really simple that I have done a thousand times already. I am trying to import a JS file into CakePHP using the Html Helper and get the attribute instead of the src attribute "facebook". That's what I'm doing: -

echo $this->Html->script('bootstrap.min');

and here is the result: -

<script type="text/javascript" facebook="/js/bootstrap.min.js">

I am using the new CakePHP 2.7.6 installation.

+4
source share
2 answers

Just keep the js folder in the webroot directory and it will work with hope.

Secondly, you wrote the correct syntax

<?php echo $this->Html->script('bootstrap.min'); ?> 

thirdly, it also depends on the .htaccess file. if you didn’t get the correct path, tell me where you saved your project and what you wrote in your .htaccess file.

Thanks.

+1

CakePHP HtmlHelper ?

HtmlHelper, , sprintf() of $this->_tags['javascriptlink'], 103 : -

'<script type="text/javascript" src="%s"%s></script>'

facebook. . , , .

+1

Source: https://habr.com/ru/post/1616326/


All Articles