public function selectRenderer(ViewEvent $e)
    {
        $model = $e->getModel();
        if ($model instanceof ImageModel) {
            if (!$model->getImage() instanceof ImageInterface) {
                if (!$model->getImagePath()) {
                    throw new Exception\RuntimeException(
                        'You must provide Imagine\Image\ImageInterface or path of image'
                    );
                }
                $model->setImage($this->imagine->open($model->getImagePath()));
            }

            return new ImageRenderer();
        }
    }
public function selectRenderer(ViewEvent $e)
    {
        $model = $e->getModel();
        if ($model instanceof ImageModel) {
            if (!$model->getImage() instanceof ImageInterface) {
                if (!$model->getImagePath()) {
                    throw new Exception\RuntimeException(
                        'You must provide Imagine\Image\ImageInterface or path of image'
                    );
                }
                $model->setImage($this->imagine->open($model->getImagePath()));
            }

            return new ImageRenderer();
        }
    }
public function selectRenderer ( ViewEvent $ e ) { $ model = $ e -> getModel ( ) ; if ( $ model instanceof ImageModel ) { if ( ! $ model -> getImage ( ) instanceof ImageInterface ) { if ( ! $ model -> getImagePath ( ) ) { throw new Exception \ RuntimeException ( 'You must provide Imagine\Image\ImageInterface or path of image' ) ; } $ model -> setImage ( $ this -> imagine -> open ( $ model -> getImagePath ( ) ) ) ; } return new ImageRenderer ( ) ; } }
Sets ImageRenderer as Renderer when ImageModel is used

@param  ViewEvent                  $e
@return ImageRenderer|null
@throws Exception\RuntimeException
Sets ImageRenderer as Renderer when ImageModel is used