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