doutong4088 2013-08-10 06:32
浏览 26
已采纳

从default.php隐藏传递变量不起作用 - joomla 3

hi im new on module development. i need to know how to pass a variable from tmpl/default.php to mod_.php since i couldnt achive it from the tutorials that i have reffered. this is how i used:

 tmpl/default.php (not the full code)
    <form action="index.php" method="post" id="sc_form">
    <input type="hidden" name="form_send" value="send" />
    <label>Your name:</label><br/>
    <input type="text" name="your_name" value="" size="40" /><br/><br/>

    <label>Your question:</label><br/>
    <textarea name="your_question" rows="5" cols="30"></textarea><br/><br/>

    <input type="submit" name="send" value="Send" />

    </form>

   -----------------------------------------------------------------------------------

mod_modulename.php

   $form_send = JRequest::getVar('form_send', 'notsend');

    switch($form_send){

    case 'send':     
    require(JModuleHelper::getLayoutPath('mod_<module_name>', 'sendok'));
    break;

    default:
    require(JModuleHelper::getLayoutPath('mod_<module_name>', 'default'));

}

thank you very very much for consideration. this will be a great great help for me...

  • 写回答

1条回答 默认 最新

  • donqo88682 2013-08-10 09:29
    关注

    The JRequest method is deprecated in 3. Use JInput instead. Ex:

    $input = JFactory::getApplication()->input;
    $form_send  = $input->get('form_send', 'notsend');
    

    Hope it helps

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 C# TCP服务端,客户端退出后,不断有数据进来
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?