简体   繁体   English

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

[英]passing variable as hidden from default.php is not working - 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. 我需要知道如何将变量从tmpl / default.php传递给mod_.php,因为我无法从参考的教程中获得它。 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 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... 这将对我有很大的帮助...

The JRequest method is deprecated in 3. Use JInput instead. JRequest方法在3中已弃用。请改用JInput Ex: 例如:

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

Hope it helps 希望能帮助到你

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

相关问题 如何通过Ajax将default.php中的值传递给view.html.php-joomla3.x - How to pass a value from default.php to view.html.php through ajax - joomla3.x Joomla。 如何在default.php中编辑菜单的链接? - Joomla. How to edit the link of the Menu in default.php? 在joomla组件中的default.php内部查看路径 - View path inside default.php in joomla component Joomla 2.5在default.php中加载javaScript文件 - Joomla 2.5 Loading javaScript Files inside default.php 在Virtuemar选项卡/ default.php / Joomla 3.7.5中插入Chronoforms - Insert Chronoforms in Virtuemar tabs / default.php / Joomla 3.7.5 如何将$ _GET [&#39;&#39;]值从mod_modulenamet / mpl / default.php中的$ document-&gt; addStylesheet()转换为joomla模块的css.php文件 - How to $_GET [' '] value from $document->addStylesheet() in mod_modulenamet/mpl/default.php to css.php file of joomla module joomla 2.5模块:如何将foreach循环放入tmpl / default.php - joomla 2.5 module: how to foreach loop put in tmpl/default.php 如何在Joomla 3 default.php文件中更改菜单类以模仿自定义菜单类 - How to change the menu classes in Joomla 3 default.php file to mimic custom menu classes 在php和joomla中将数组变量从一页传递到另一页 - Passing array variable from one page to another in php and joomla 默认值,如果变量隐藏 PHP - default value if variable hidden PHP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM