change nav-helper

This commit is contained in:
Jack Freeman 2015-02-06 22:15:28 +08:00
parent 2e3fec30cd
commit d209a34b80
1 changed files with 3 additions and 6 deletions

View File

@ -49,17 +49,14 @@ class Layout
$inlineScriptHelper = $viewHelperManager->get('inlineScript');
$inlineScriptHelper ->captureStart();
echo "$('#page-nav-".$this->getControllerNavName($controller)."-".$action."').addClass('active');";
echo "$('#Nav-".$this->getControllerNavName($controller)."-".$action."').addClass('active');";
$inlineScriptHelper ->captureEnd();
}
public function getControllerNavName($invokename)
{
$ctl = array(
'Application\Controller\Index' => 'index',
'Application\Controller\Account' => 'account'
);
return isset($ctl[$invokename]) ? $ctl[$invokename]:"";
$controller_spell = explode("\\",$invokename);
return strtolower(end($controller_spell));
}
//添加用户Ajax脚本