/** * http 方法 * 自定义菜单 */ public function createMenuAction() { $user = $this->authentication()->getIdentity(); if ($user->role != UserEntity::ROLE_ADMIN) { echo '您无权限此操作,请联系管理员'; } $result = $this->wechat->createMenu(); echo '菜单创建' . ($result ? "成功" : "失败"); $this->layout()->setTerminal(true); }