codeigniter中的动态活动类

时间:2016-06-28 17:53:36

标签: codeigniter navigation

我的菜单中有很多li

<li class="<?php if($this->uri->segment(1)=='user'|| 'role'|| 'sections' || 'actions') {echo 'active open';} else {echo 'noactive';} ?>">

即使控制器名称不在url中,它始终处于打开阶段,因此任何建议

1 个答案:

答案 0 :(得分:1)

你的病情不对。试试这个

<li class="<?php if(($this->uri->segment(1) == 'user') || ($this->uri->segment(1) == 'role') || ($this->uri->segment(1) == 'sections') || ($this->uri->segment(1) == 'actions')) {echo 'active open';} else {echo 'noactive';} ?>">