Symfony:在一个调用中设置两个响应

Symfony: set two responses in one call

getSettings 中的值移至 getConfiguration 调用。 不需要调用,所以我需要删除该方法,但它的响应应该是配置服务响应的一部分。

    /**
 * @Route("/config", name="app_config")
 * @return \Symfony\Component\HttpFoundation\JsonResponse
 */
public function getAppConfigurationAction()
{
    $data = [
        'linkedin' => true,
        'xceedium' => true
    ];


    return $this->success($data);
}

/**
 * @Route("/home", name="home_screen")
 * @return \Symfony\Component\HttpFoundation\JsonResponse
 */
public function getHomeScreenApplicationSettings()
{
    $data = [
        'liveFeed' => 'fasle',
        '1 Xceed ' => '20 Euro'
    ];

    return $this->success($data);
}

如何将 getHomeScreenApplicationSettings 的内容合并到 getAppConfigurationAction

像这样:

/**
 * @Route("/config", name="app_config")
 * @return \Symfony\Component\HttpFoundation\JsonResponse
 */
public function getAppConfigurationAction()
{
    $data = [
        'linkedin' => true,
        'xceedium' => true,
        'liveFeed' => 'fasle',
        '1 Xceed ' => '20 Euro'
    ];


    return $this->success($data);
}

如果有人使用已删除的路线,您应该小心/home

希望我能理解您的顾虑,如果不理解,请随时指导我:)