php – Joomla中的后端操作不起作用

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – Joomla中的后端操作不起作用脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
当我创建动作,然后单击它,我得到js错误

未捕获的TyPEError:无法读取未定义的属性任务”(在chrome中)
TypeError:b未定义(以ff为单位)

我的代码是:

view.htML.PHP

<?// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view');


class ObshViewObsh extends JView
{

    function display($tpl = null)
    {

        $task = JRequest::getVAR('task','');
        swITch($task){            
            case 'config': $this->config();break;
            default: $this->windows();
        }

        parent::display($tpl);
    }

    function windows(){
        JToolBarHelper::title( JText::_( 'Общежития' ),'generic.png' ); 
        JToolBarHelper::custom('config','options','','Настройки',false); //<<< --- this link doesn't work

    }

     function config(){
        JToolBarHelper::title( JText::_( 'Общежития - настройка компонента' ),'generic.png' );
        JToolBarHelper::apply('edit_config');
        JToolBarHelper::cancel('cancel');    
    }          

}

Controller.PHP这样

<?PHP
 error_reporting(E_ALL);
// No direct access

defined( '_JEXEC' ) or die( 'Restricted access' );

jimport('joomla.application.COMponent.controller');


class ObshController extends JController
{       

    function config(){
        JRequest::setVar( 'view','obsh' );
        JRequest::setVar( 'layout','config'  );
        JRequest::setVar( 'hidemainmenu',1 );
        parent::display();
    }        
}
答案很简单就像……

我忘了在视图中添加表单

<form action="index.PHP" method="post" name="adminForm">

    something

    <input type="hidden" name="option" value="com_obsh" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="Boxchecked" value="0" />
</form>

脚本宝典总结

以上是脚本宝典为你收集整理的php – Joomla中的后端操作不起作用全部内容,希望文章能够帮你解决php – Joomla中的后端操作不起作用所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。