change nav-helper
This commit is contained in:
parent
2e3fec30cd
commit
d209a34b80
|
@ -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脚本
|
||||
|
|
Loading…
Reference in New Issue