I'm building a menu plugin that inserts strings into the document. As far as I can tell (in the absence of docs), I need to create a separate command for every item. Each menu item does something like this, where i is a loop index and t is an array of appropriate strings:
editor.addCommand( 'insertTag_'+i, {
exec: function( editor ) {
editor.insertHtml( t[1] );
}
});
Then each menuItem gets assigned this command with:
command: 'insertTag_'+i,
as part of its definition. This seems inefficient, but since the name of the command is passed as a string I don't see how I can pass params into it so all menu items can call the same command with different params.
Alternatively, can the command element contain a closure that achieves the same thing as the command?
This is all somewhat academic since I can't figure out how to make a menu appear in the first place as the docs are a bit sparse.

The definition of a command
The definition of a command has provision for an additional data parameter, and that's supported by the addCommand and execCommand methods, however when the command of a menuItem is defined, it only accepts a string, and it is called with editor.execCommand( commandName), which does not pass additional data, so it looks like this is not possible, or it's a bug.