Имам следния код:
<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>
$item->isActive()
работи по предназначение само за началната страница. на всички други страници class="active" не се показва.
АКТУАЛИЗАЦИЯ:
Приложението използва маршрут като следния:
// 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+',
)
),
)
маршрутите се записват във файл, наречен manifest.php