0

How to call css or js file from

/app
    /webroot
          /bootstrap
                 /bootstrap.css

if i added

echo  $this->Html->css('bootstrap'); 

code in view/Locale/default.ctp its working fine .. but bootstrap.css file not taking from bootstrap folder . If i copied bootstrap.css in webroot/css folder its working fine ..

I am fresher for cakephp . Can anyone help me to resolve issue

4
  • If you want to use Twitter Bootstrap from CakePHP you'd better use a proper plug-in that overrides the default helpers. You should be able one or more in the plugin and packages directory. Commented Jan 2, 2015 at 9:24
  • actally i m using bootstrap theme. Commented Jan 2, 2015 at 10:06
  • how to use plugins in cake php . Commented Jan 2, 2015 at 10:09
  • Plugins. Alternatively, you can just read the installation instructions of the chosen plugin—you have to read them anyway and it might be enough. Commented Jan 2, 2015 at 10:27

2 Answers 2

1

The path that you provide in $this->Html->css() is the path of webroot, If you have a sub-folder under webroot, and the css file is in the sub-folder,you have to specify the sub-folder name, like this:

$this->Html->css('bootstrap/bootstrap');

Sign up to request clarification or add additional context in comments.

Comments

1

use this hope this Help

$this->Html->css('/bootstrap/bootstrap');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.