PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, February 13, 2022

[FIXED] how can i link a bootstrap js file and css file to Cakephp 3x

 February 13, 2022     cakephp-3.0, php     No comments   

Issue

im trying to link a bootstrap js file and css file to Cakephp 3x

<?= $this->Html->css('bootstrap') ?> 
<?= $this->Html->css('bootstrap-theme') ?>  

i use this code to src/Template/Layout/default.ctp and the css file is working but when i try to link the js with the same approach

<?= $this->Html->script('jquery') ?> 
<?= $this->Html->script('bootstrap') ?>  

the problem is the Js is not working, thank you for your response


Solution

You can include js like this

  <?= $this->Html->script('https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js') ?>

Or if your js file exist in your project then it must be in webroot/js folder then you can include file like this

 <?= $this->Html->script('custom.js') ?>


Answered By - shubham715
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing