I have the following code:
<ul class="navigation">
<?php foreach( $this->navigation as $item ): ?>
<li class="<?php if($item->isActive()){echo " active";}?>">
<div class="shadow"></div>
<div class="tab"><?php echo $this->htmlLink($item->getHref(), $this->translate($item->getLabel())) ?></div>
</li>
<?php endforeach; ?>
</ul>
The $item->isActive()
works as intended only for the home page. on all the other pages the class="active" does not show up.
UPDATE:
The application uses route such as the following:
// Routes --------------------------------------------------------------------
'routes' => array(
'home' => array(
'route' => '/',
'defaults' => array(
'module' => 'core',
'controller' => 'index',
'action' => 'index'
)
),
'core_home' => array(
'route' => '/',
'defaults' => array(
'module' => 'core',
'controller' => 'index',
'action' => 'index'
)
),
'confirm' => array(
'route'=>'/confirm',
'defaults' => array(
'module'=>'core',
'controller'=>'confirm',
'action'=>'confirm'
)
),
// Admin - General
'core_admin_settings' => array(
'route' => "admin/core/settings/:action/*",
'defaults' => array(
'module' => 'core',
'controller' => 'admin-settings',
'action' => 'index'
),
'reqs' => array(
'action' => '\D+',
)
),
)
the routes are save in a file called manifest.php