public function setJson($key, $value = null): void
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setJson($k, $v);
            }
            return;
        }

        $this->_jsonData[$key] = $value;
    }
public function setJson($key, $value = null): void
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setJson($k, $v);
            }
            return;
        }

        $this->_jsonData[$key] = $value;
    }
public function setJson ( $ key , $ value = null ) : void { if ( is_array ( $ key ) ) { foreach ( $ key as $ k => $ v ) { $ this -> setJson ( $ k , $ v ) ; } return ; } $ this -> _jsonData [ $ key ] = $ value ; }
Pass data to the frontend controller

@param string|array $key string key or array of key=>values
@param mixed $value value
@return void
Pass data to the frontend controller