简体   繁体   English

创建一个Joomla php模块

[英]Creating a Joomla php module

I wish to know how to create a Joomla PHP Module. 我想知道如何创建一个Joomla PHP模块。 That is, i want to create a module where i write my own "PHP" code to perform certain functions. 也就是说,我想创建一个模块,在其中编写自己的“ PHP”代码以执行某些功能。 I thought i could just use the HTML Custom module and just write my code, but each time, i just got the same code back as plain text that has not been processed. 我以为我可以只使用HTML Custom模块并编写代码,但是每次,我都会得到与未经处理的纯文本相同的代码。 Even when i disable the editor from the back-end, it does the same thing. 即使当我从后端禁用编辑器时,它也会做同样的事情。 How can is it done? 怎么做? My code could perform some action similar to the following code: 我的代码可以执行类似于以下代码的某些操作:

<?php
  function moduleH()
{
  return DB::getCourses();
}
?>

You don't even need to create a module. 您甚至不需要创建模块。 JCE Editor allows you to do that (provided you allow PHP in the default options for JCE). JCE编辑器允许您执行此操作(前提是您在JCE的默认选项中允许使用PHP)。 Or you can just use Jumi which is a Joomla extension specifically built for this purpose. 或者,您可以只使用Jumi,这是专门为此目的而构建的Joomla扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM