MenuController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. /**
  3. * FecShop file.
  4. *
  5. * @link http://www.fecshop.com/
  6. * @copyright Copyright (c) 2016 FecShop Software LLC
  7. * @license http://www.fecshop.com/license/
  8. */
  9. namespace fecadmin\controllers;
  10. use Yii;
  11. use yii\helpers\Url;
  12. use fec\helpers\CUrl;
  13. use fecadmin\FecadminbaseController;
  14. /**
  15. * @author Terry Zhao <2358269014@qq.com>
  16. * @since 1.0
  17. */
  18. class MenuController extends FecadminbaseController
  19. {
  20. # 菜单管理
  21. public function actionManager()
  22. {
  23. //echo $this->action->id ;exit;
  24. $data = $this->getBlock()->getLastData();
  25. return $this->render($this->action->id,$data);
  26. }
  27. # 菜单管理
  28. public function actionEdit()
  29. {
  30. //echo $this->action->id ;exit;
  31. $this->getBlock("manager")->edit();
  32. }
  33. public function actionEditsave(){
  34. $this->getBlock("manager")->editMenuSave();
  35. }
  36. # 创建菜单
  37. public function actionCreate(){
  38. //$data = $this->getBlock()->getLastData();
  39. $editSaveUrl = CUrl::getUrl("fecadmin/menu/createsave");
  40. return $this->render($this->action->id,['editSaveUrl'=>$editSaveUrl]);
  41. }
  42. public function actionCreatesave(){
  43. $this->getBlock("manager")->createMenuSave();
  44. }
  45. public function actionDelete(){
  46. $this->getBlock("manager")->deleteMenu();
  47. }
  48. }