我有一个我创建的php文件.我想扩展所有的Joomla!该文件的类.或者我至少希望能够使用Joomla的类来访问我的PHP文件中的数据库.如何以这种方式扩展功能?提前致谢.
把这些行放在你的php文件之上
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__).'/../../../../' ); // should point to joomla root
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
Run Code Online (Sandbox Code Playgroud)
现在你可以在这里使用所有的joomla类
| 归档时间: |
|
| 查看次数: |
1654 次 |
| 最近记录: |