src/Controller/AdminControllerEvent.php
public function addViewVariables($name, $data = [], $priority = 0)
    {
        if (is_array($name)) {
            if (!isset($name['name'])) {
                throw new \DomainException('Key "name" must be specified, if array is passed as first parameter.');
            }
            if (is_int($data)) {
                $priority = $data;
            }
            $data = $name;
            $name = $data['name'];
        } elseif (is_int($data)) {
            $priority = $data;
            $data = [];
        }

        if (!isset($data['name'])) {
            $data['name'] = $name;
        }

        return $this->addViewTemplate($name, "core/admin/dashboard-widget", $data, $priority);
    }
public function addViewVariables($name, $data = [], $priority = 0)
    {
        if (is_array($name)) {
            if (!isset($name['name'])) {
                throw new \DomainException('Key "name" must be specified, if array is passed as first parameter.');
            }
            if (is_int($data)) {
                $priority = $data;
            }
            $data = $name;
            $name = $data['name'];
        } elseif (is_int($data)) {
            $priority = $data;
            $data = [];
        }

        if (!isset($data['name'])) {
            $data['name'] = $name;
        }

        return $this->addViewTemplate($name, "core/admin/dashboard-widget", $data, $priority);
    }
public function addViewVariables ( $ name , $ data = [ ] , $ priority = 0 ) { if ( is_array ( $ name ) ) { if ( ! isset ( $ name [ 'name' ] ) ) { throw new \ DomainException ( 'Key "name" must be specified, if array is passed as first parameter.' ) ; } if ( is_int ( $ data ) ) { $ priority = $ data ; } $ data = $ name ; $ name = $ data [ 'name' ] ; } elseif ( is_int ( $ data ) ) { $ priority = $ data ; $ data = [ ] ; } if ( ! isset ( $ data [ 'name' ] ) ) { $ data [ 'name' ] = $ name ; } return $ this -> addViewTemplate ( $ name , "core/admin/dashboard-widget" , $ data , $ priority ) ; }
Creates a view model with default template,

For syntax of the $data array, see the default template
.. Core/view/core/admin/dashboard-widget.phtml

@param string      $name Name of the captureTo key.
@param array $data
@param int   $priority

@return AdminControllerEvent
@throws \DomainException if no name is passed.
Creates a view model with default template