1

I am unable to load css in cakephp. my directory structure is this

          webroot/
                   -bootstrap/
                              -css/
                                   bootstrap.min.css
                              -js
                              -fonts
                    -dist/
                           -css/
                    -plugin/
                            -font-awesome

I am using $this->Html->css(); which point to css directory.

1 Answer 1

1

Use like this

$this->Html->css('/bootstrap/css/bootstrap.min.css');
Sign up to request clarification or add additional context in comments.

4 Comments

You can also specify a path relative to the css folder like ../bootstrap/css/bootstrap.min.css.
its giving path "/bootstrap/css/bootstrap.min.css" in source which is unavailable. i am running on localhost. inside ci my directory stucture is this. localhost/codeigniter_folder/cakephpfolder/webroot//bootstrap/…
I have tested it in cakephp 3.x and its working for me. Which version of cakephp are you using
its working after setting RewriteBase in .htaccess. i am using 3.x version. thanks @Aman Rawat

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.