public function formatter($value, $type, array $options = [], array $variables = [])
    {
        $options = array_replace(['wrapped' => false, 'inherit_data' => false], $options, ['data' => $value]);
        $type = isset($this->aliases[$type]) ? $this->aliases[$type] : $type;

        if (isset($options['entry_type']) && isset($this->aliases[$options['entry_type']])) {
            $options['entry_type'] = $this->aliases[$options['entry_type']];
        }

        /* @var BlockInterface $block */
        $block = $this->createNamed($type, $options);

        return $this->renderer->searchAndRenderBlock($block->createView(), 'widget', $variables);
    }
public function formatter($value, $type, array $options = [], array $variables = [])
    {
        $options = array_replace(['wrapped' => false, 'inherit_data' => false], $options, ['data' => $value]);
        $type = isset($this->aliases[$type]) ? $this->aliases[$type] : $type;

        if (isset($options['entry_type']) && isset($this->aliases[$options['entry_type']])) {
            $options['entry_type'] = $this->aliases[$options['entry_type']];
        }

        /* @var BlockInterface $block */
        $block = $this->createNamed($type, $options);

        return $this->renderer->searchAndRenderBlock($block->createView(), 'widget', $variables);
    }
public function formatter ( $ value , $ type , array $ options = [ ] , array $ variables = [ ] ) { $ options = array_replace ( [ 'wrapped' => false , 'inherit_data' => false ] , $ options , [ 'data' => $ value ] ) ; $ type = isset ( $ this -> aliases [ $ type ] ) ? $ this -> aliases [ $ type ] : $ type ; if ( isset ( $ options [ 'entry_type' ] ) && isset ( $ this -> aliases [ $ options [ 'entry_type' ] ] ) ) { $ options [ 'entry_type' ] = $ this -> aliases [ $ options [ 'entry_type' ] ] ; } /* @var BlockInterface $block */ $ block = $ this -> createNamed ( $ type , $ options ) ; return $ this -> renderer -> searchAndRenderBlock ( $ block -> createView ( ) , 'widget' , $ variables ) ; }
Format the value.

@param mixed  $value     The value to format
@param string $type      The formatter type
@param array  $options   The block options
@param array  $variables The template variables

@return string
Format the value .