I wrote a component in Joomla 2.5 and I use this
JSubMenuHelper::addEntry('Alpha', 'index.php?option=com_teams&task=showA');
JSubMenuHelper::addEntry('Beta', 'index.php?option=com_teams&task=showB',true);
JSubMenuHelper::addEntry('Gamma', 'index.php?option=com_teams&task=showC');
...
in each of the view.html.php files to switch from on view to another.
This works fine, but it is annoying if I add or change a menu item, because I have to change it in all the files individually.
What is the best (and conform to MVC design) way to accomplish that? I guess just simply use the php methods (include or require) isn't the way to go.