PHP Kohana 包含问题
我现在正在处理一个非常奇怪且相当简单的问题大约两天了。 我敢打赌解决方案是显而易见的,但我只是不知道还能做什么。
我正在 Kohana 框架中工作。 在我的 C:/wamp/www 文件夹中,我有两个不同的站点:mysite1 和 mysite2。
所以我让 fckeditor 在 mysite1 站点中工作,如下所示:
包括(url::base(FALSE)。“static/scripts/fckeditor/fckeditor.php”); ->包括(mysite/web/admin/static/scripts/fckeditor/fckeditor.php)
并且效果非常好!
好吧,我决定将 fckeditor 合并到 mysite2 中,并且我使用完全相同的命令.. 它只是不起作用,并且出现错误消息:
没有这样的文件或目录。
我向你保证 fckeditor 存在于
中 mysite2/web/admin/static/scripts/fckeditor/fckeditor.php 。
完整路径(C:/wamp/www/mysite2/web/admin/static/scripts/fckeditor/fckeditor.php)路径包含作品 我只想让 include(url::base(FALSE)."static/scripts/fckeditor/fckeditor.php") 工作...
可能出了什么问题?
谢谢!
I am dealing with a very strange and rather simple problem about 2 days now.
I bet the solutions is obvious but i just dont know what else to do.
I am working in Kohana framework.
In my C:/wamp/www folder i have two different sites: mysite1 and mysite2.
So i have the fckeditor working in the mysite1 site included like this:
include(url::base(FALSE)."static/scripts/fckeditor/fckeditor.php"); -> include(mysite/web/admin/static/scripts/fckeditor/fckeditor.php)
and works like a charm!
Well i decided to incorporate fckeditor in mysite2, and i use the very same command..
and it just does not work and there is an erro message:
no such file or directory..
I assure you that fckeditor exists in
mysite2/web/admin/static/scripts/fckeditor/fckeditor.php
The full path (C:/wamp/www/mysite2/web/admin/static/scripts/fckeditor/fckeditor.php ) path include works. I just want to get include(url::base(FALSE)."static/scripts/fckeditor/fckeditor.php") working...
What could possibly be wrong??
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您需要包含文件时,可以使用 find_file() 方法。所以,你的代码看起来像
When you need to include files, you can use find_file() method. So, your code will looks like
如果完整路径工作正常,但使用 url 帮助程序的路径不起作用,则可能是站点配置错误。
您使用
url::base
包含的内容是否有效?查看页面的输出,
url::base(FALSE)."static/scripts/fckeditor/fckeditor.php"
的计算结果是什么?查看 config.php,确保您的 site_domain 设置正确。
If the full path works fine, but the path using the url helper doesn't work, it's probably a site configuration error.
Do any of your includes using
url::base
work?Looking at the output of your page, what does
url::base(FALSE)."static/scripts/fckeditor/fckeditor.php"
evaluate to?Take a look at config.php, make sure your site_domain is set up properly.