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

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

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?