I'll jump right in...
I'm following the helloworld component example and I've ran into such a problem that I can't even troubleshoot (how would you go around doing this?)
So here's the deal:
I wanted to create a Sidebar with 2 entries and each directing to a view. I used this code in my helper function which exposes a class OwrHelper () ...
Code: Select all
public function addSubmenu($vName)
{
JHtmlSidebar::addEntry(
Text::_('COM_OWR'),
'index.php?option=com_owr&view=owr',
$vName == 'owr_main');
JHtmlSidebar::addEntry(
Text::_('COM_OWR_CONFIGURATION'),
'index.php?option=com_owr&view=owr_options',
$vName == 'owr_options');
}
Code: Select all
<?php echo $this->sidebar; ?>
Code: Select all
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/owr.php';
$controller = BaseController::getInstance('owr');
$controller->execute(Factory::getApplication()->input->get('task'));
$controller->redirect();
But here is what i get in the administrator/index.php?option=com_owr sidebar:
Looks as though it is rendered 4 times and i have no idea why !