joomla2.5 中如何 require_once [英] How require_once in joomla2.5

查看:19
本文介绍了joomla2.5 中如何 require_once的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 joomla 中遇到了有关 require_once 的问题.

I Have a problem about require_once in joomla.

在这个文件中 php:

In this file php:

componentscom_testviews\__test_r5	mpldefault.php

我想使用此代码包含一些文件:

I want to include some file using this code:

require_once (JPATH_ROOT.DS.'/includes/General.php');

但是 require_once 不起作用

but require_once does not works

推荐答案

您尝试包含的路径的计算结果类似于:joomla//includes/General.php.注意"includes" 之前的双斜线.常量 DS 被定义为目录分隔符.

The path you are trying to include will evaluate to something like: joomla//includes/General.php. Notice the double slashes before "includes". The constant DS is defined to be a directory separator.

试试:
require_once (JPATH_ROOT.'/includes/General.php');
 (没有DS)

这篇关于joomla2.5 中如何 require_once的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆