Eccube\Controller\Admin\Store\PluginController::readme PHP Method

readme() public method

対象プラグインの README を返却します。
public readme ( Application $app, Request $request, $id )
$app Eccube\Application
$request Symfony\Component\HttpFoundation\Request
    public function readme(Application $app, Request $request, $id)
    {
        if ($request->isXmlHttpRequest()) {
            $Plugin = $app['eccube.repository.plugin']->find($id);
            if (!$Plugin) {
                $response = new Response(json_encode('NG'), 400);
                $response->headers->set('Content-Type', 'application/json');
                return $response;
            }
            $code = $Plugin->getCode();
            $readme = $app['config'][$code]['const']['readme'];
            $data = array('code' => $code, 'name' => $Plugin->getName(), 'readme' => $readme);
            $response = new Response(json_encode($data));
            $response->headers->set('Content-Type', 'application/json');
            return $response;
        }
        $response = new Response(json_encode('NG'), 400);
        $response->headers->set('Content-Type', 'application/json');
        return $response;
    }