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