@@ -23,8 +23,7 @@ class IndexController extends Controller
2323 //全局操作
2424 const GLOBAL_ACTION_RESET = 999 ;
2525 //自定义菜单
26- const MENU_MAIN_1 = 'MENU_MAIN_1 ' ;
27- const MENU_MAIN_2 = 'MENU_MAIN_2 ' ;
26+ const MENU_MAIN_3 = 'MENU_MAIN_3 ' ;
2827 const MENU_MAIN_1_CHILD_1 = 'MENU_MAIN_1_CHILD_1 ' ;
2928 const MENU_MAIN_2_CHILD_1 = 'MENU_MAIN_2_CHILD_1 ' ;
3029
@@ -311,12 +310,10 @@ private function _handleEvent(array $data)
311310 private function _handleMenuClick ($ key )
312311 {
313312 switch ($ key ) {
314- case self ::MENU_MAIN_1 :
315- return array ('您点击了主菜单1 ' , 'text ' );
313+ case self ::MENU_MAIN_3 :
314+ return array ('您点击了主菜单3 ' , 'text ' );
316315 case self ::MENU_MAIN_1_CHILD_1 :
317316 return array ('您点击了 主菜单1->子菜单1 ' , 'text ' );
318- case self ::MENU_MAIN_2 :
319- return array ('您点击了主菜单2 ' , 'text ' );
320317 case self ::MENU_MAIN_2_CHILD_1 :
321318 return array ('您点击了 主菜单2->子菜单1 ' , 'text ' );
322319 default :
@@ -335,7 +332,6 @@ public function menu()
335332 array (
336333 'type ' => 'click ' ,
337334 'name ' => '主菜单1 ' ,
338- 'key ' => self ::MENU_MAIN_1 ,
339335 'sub_button ' => array (
340336 array (
341337 'type ' => 'click ' ,
@@ -352,7 +348,6 @@ public function menu()
352348 array (
353349 'type ' => 'click ' ,
354350 'name ' => '主菜单2 ' ,
355- 'key ' => self ::MENU_MAIN_2 ,
356351 'sub_button ' => array (
357352 array (
358353 'type ' => 'click ' ,
@@ -365,6 +360,11 @@ public function menu()
365360 'url ' => 'http://www.qq.com '
366361 )
367362 )
363+ ),
364+ array (
365+ 'type ' => 'click ' ,
366+ 'name ' => '主菜单3 ' ,
367+ 'key '
368368 )
369369 )
370370 );
0 commit comments