开发者

relative URLs in cakePHP

开发者 https://www.devze.com 2023-01-05 23:22 出处:网络
I am using cakePHP 1.26 and TinyMCE v3.38. The .js file of the TinyMSC is stored under this directory:

I am using cakePHP 1.26 and TinyMCE v3.38.

The .js file of the TinyMSC is stored under this directory:

http://www.mysite/js/tiny_mce/tiny_mce.js

In the page where the users can post new topic,

the URL of this page is like this:

http://www.mysite/user/newpost

Now I need to add the javascript to this page, and I have tried these:

echo $javascript->l开发者_如何学JAVAink('/js/tiny_mce/tiny_mce.js');

echo $javascript->link('js/tiny_mce/tiny_mce.js');

echo $javascript->link('../js/tiny_mce/tiny_mce.js');

But the tiny_mce.js can not be reached.


I believe that Cake already knows that your javascript is in /js/ through using the $javascript->link() structure in the first place - so try

echo $javascript->link('tiny_mce/tiny_mce.js');

and see if you get anywhere.

0

精彩评论

暂无评论...
验证码 换一张
取 消