How to send the task variable in Joomla

余生长醉 提交于 2019-12-13 02:44:52

问题


I have a menu item in joomla (virtuemart) with url

index.php?option=com_virtuemart&view=manufacturer

Now, in view.html.php of manufacturer view I added a function called jump as

function jump(){echo "hello";}

I added task=jump in the url so that it becomes

index.php?option=com_virtuemart&view=manufacturer&task=jump

But even now the default display function executes and not the jump function. Why? Please help me. Thanks


回答1:


The task in this url index.php?option=com_virtuemart&view=manufacturer&task=jump will execute the jump function of default controller.So if there is any function jump in the controller.php will execute not the jump function of view.If you want to execute jump of any other controller use this structure task=controllername.taskname

Read More - http://docs.joomla.org/JController_and_its_subclass_usage_overview https://groups.google.com/forum/?fromgroups=#!topic/joomla-dev-general/ZkNhbX2x1Es http://docs.joomla.org/How_Joomla_pieces_work_together

Hope this is clear.



来源:https://stackoverflow.com/questions/14535282/how-to-send-the-task-variable-in-joomla

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!