core/web/JsonLd.php
public static function addGraph($data)
    {
        self::registerView();
        
        if (is_scalar($data)) {
            throw new Exception("Data must be either an array or an object of type luya\web\jsonld\BaseThing.");
        }
        
        Yii::$app->view->params['@context'] = 'https://schema.org';
        Yii::$app->view->params['@graph'][] = $data;
        
        return $data;
    }
public static function addGraph($data)
    {
        self::registerView();
        
        if (is_scalar($data)) {
            throw new Exception("Data must be either an array or an object of type luya\web\jsonld\BaseThing.");
        }
        
        Yii::$app->view->params['@context'] = 'https://schema.org';
        Yii::$app->view->params['@graph'][] = $data;
        
        return $data;
    }
public static function addGraph ( $ data ) { self :: registerView ( ) ; if ( is_scalar ( $ data ) ) { throw new Exception ( "Data must be either an array or an object of type luya\web\jsonld\BaseThing." ) ; } Yii :: $ app -> view -> params [ '@context' ] = 'https://schema.org' ; Yii :: $ app -> view -> params [ '@graph' ] [ ] = $ data ; return $ data ; }
Register graph data.

@param \luya\web\jsonld\BaseThing|array $data Can be either an array or an object based on {{luya\web\jsonld\BaseThing}} which contains the Arrayable Inteface.
@return array|object
Register graph data .