3

Currently I'm using using this to load in css in my CakePHP project.

echo $this->Html->css('jquery-ui',null,array('inline' => false)); 

That is assuming that I'm putting my css file in a css folder.
However, I'm now thinking about moving my css that is needed for js libraries to the js folder instead. (i.e in js/lib/jquery-ui.js AND js/lib/jquery-ui.css). That way I don't have to keep track of 2 folders with the same structure.

How can I change where CakePHP's css helper to point to a different folder?
Or is that not a good practice what I'm trying to do. (i.e moving the plugin css to live in the same folder as the js)

Thanks,
Tee

1 Answer 1

10

From the API:

If $path is prefixed with '/', the path will be relative to the webroot of your application. Otherwise, the path will be relative to your CSS path

So you'd do:

echo $this->Html->css('/js/lib/jquery-ui',null,array('inline' => false));
Sign up to request clarification or add additional context in comments.

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.