JToolBarHelper::Custom syntax

落花浮王杯 提交于 2019-12-13 04:18:50

问题


I can't quite figure out exactly what this line does from the docs:

JToolBarHelper::custom( 'masterslavesync', 'save', '', 'Save', false, false );

Is it calling a masterslavesync function somewhere (controller)? Or do I have to register it with $this->registerTask()?


回答1:


This code is used to create custom button in the joomla admin.This code will create a save and when someone click on this button it will call masterslavesync function defined in the controller. if you want to check this just create a

public function masterslavesync()
  {
      echo 'I am here';
      die;
  }

if the text is echo properly then everything is fine....Hopefully this will help you to understand to control flow. you can also refer this http://docs.joomla.org/How_to_create_a_custom_button



来源:https://stackoverflow.com/questions/10799936/jtoolbarhelpercustom-syntax

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