SF2 プロジェクトで Sonata Admin を使用して、次の管理システムをセットアップしています。「画像を表示」をクリックすると、ポップアップ/オーバーレイに画像を表示するか、簡単な場合は画像を含む新しいページを表示します。このためのルートは次のように構成されます。/admin/ayrshireminis/gallery/galleryimage/{id}/view_image
コードパスが入力する CRUDController にこのメソッドがあります。
/**
* preview the image
*
* @return RedirectResponse
*/
public function viewImageAction()
{
// work out which image we are approving based on the ID in the URL
$id = $this->get('request')->get($this->admin->getIdParameter());
$object = $this->admin->getObject($id);
// couldn't find the object
if (!$object) {
throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));
}
return $this->render('SonataAdminBundle::empty_layout.html.twig', array('image' => $object));
}
Sonata のドキュメントが見つからず、(Sonata Admin レイアウト内に) 画像を含む空白のページを単純に表示する方法を理解するにはどうすればよいでしょうか。