问题
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