src/Twig/Extension/SonataAdminExtension.php
public function renderViewElement(
        Environment $environment,
        FieldDescriptionInterface $fieldDescription,
        $object
    ) {
        $template = $this->getTemplate(
            $fieldDescription,
            '@SonataAdmin/CRUD/base_show_field.html.twig',
            $environment
        );

        try {
            $value = $fieldDescription->getValue($object);
        } catch (NoValueException $e) {
            $value = null;
        }

        return $this->render($fieldDescription, $template, [
            'field_description' => $fieldDescription,
            'object' => $object,
            'value' => $value,
            'admin' => $fieldDescription->getAdmin(),
        ], $environment);
    }
public function renderViewElement(
        Environment $environment,
        FieldDescriptionInterface $fieldDescription,
        $object
    ) {
        $template = $this->getTemplate(
            $fieldDescription,
            '@SonataAdmin/CRUD/base_show_field.html.twig',
            $environment
        );

        try {
            $value = $fieldDescription->getValue($object);
        } catch (NoValueException $e) {
            $value = null;
        }

        return $this->render($fieldDescription, $template, [
            'field_description' => $fieldDescription,
            'object' => $object,
            'value' => $value,
            'admin' => $fieldDescription->getAdmin(),
        ], $environment);
    }
public function renderViewElement ( Environment $ environment , FieldDescriptionInterface $ fieldDescription , $ object ) { $ template = $ this -> getTemplate ( $ fieldDescription , '@SonataAdmin/CRUD/base_show_field.html.twig' , $ environment ) ; try { $ value = $ fieldDescription -> getValue ( $ object ) ; } catch ( NoValueException $ e ) { $ value = null ; } return $ this -> render ( $ fieldDescription , $ template , [ 'field_description' => $ fieldDescription , 'object' => $ object , 'value' => $ value , 'admin' => $ fieldDescription -> getAdmin ( ) , ] , $ environment ) ; }
render a view element.

@param mixed $object

@return string
render a view element .