Php 在joomla中创建一个简单的文件上载
我是乔姆拉的新手。 a为joomla创建一个基本模块。这是我模块中的文件结构Php 在joomla中创建一个简单的文件上载,php,joomla,Php,Joomla,我是乔姆拉的新手。 a为joomla创建一个基本模块。这是我模块中的文件结构 mod_upload.xml mod_upload.php helper.php 我把这个表单放在helper.php中 <form action="mod_upload.php" method="post" enctype="multipart/form-data"> Filename: <input type="file" name="file" id="file"><br>
mod_upload.xml
mod_upload.php
helper.php
我把这个表单放在helper.php中
<form action="mod_upload.php" method="post"
enctype="multipart/form-data">
Filename:
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
现在我想知道如何为表单设置操作,将我的文件从helper.php发送到mod_upload.php创建文件夹tmpl并在那里创建文件default.php。在她的位置、形式和行动中写下:
<?php echo JRoute::_('index.php'); ?>
在mod_upload.php中调用此函数:
不是Joomla专家,但当我在Joomla中通过谷歌创建一个简单的文件上传时,我会得到一些教程和其他资源,其中一个可能有用?我会在提问前搜索。但我没有找到任何关于我的问题的资源。请看Joomla文档上的模块开发。html结构不在helper.php中,而是在default.php中。我刚才回答了你的问题,基本上和这个问题一样:非常感谢,我的问题解决了。
<?php echo JRoute::_('index.php'); ?>
class modUpload
{
static function PostForm()
{
$post = JRequest::get('post'); //It's params of post form
}
}
defined('_JEXEC') or die;
require_once dirname(__FILE__).'/helper.php';
modUploadHelper::PostForm(); //It's
require JModuleHelper::getLayoutPath('mod_upload', $params->get('layout', 'default'));