Your IP : 216.73.216.240


Current Path : /home/juvelize/saulnois/tmp/install_695d2cf0b4957/src/View/Sd/
Upload File :
Current File : /home/juvelize/saulnois/tmp/install_695d2cf0b4957/src/View/Sd/SdCarousel.php

<?php
/*
* @package		Tech Fry Library
* @license		https://www.gnu.org/licenses/gpl-3.0.en.html
*/

namespace TechFry\Library\View\Sd;

defined('_JEXEC') or die;

// https://developers.google.com/search/docs/appearance/structured-data/carousel
class SdCarousel
{
    public static function get_output($data = array())
    {
        // Supported Types: Course, Movie, Recipe, Restaurant
        // Summary page and multiple detail pages
        
        $json = array(
            "@context" => "https://schema.org",
            "@type" => "ItemList",
            "itemListElement" => array(),
        );

        $n = 1; // Starting position
        foreach ($data as $item)
        {
            $json["itemListElement"][] = array(
                "@type" => "ListItem",
                "position" => $n,
                "url" => $item['url'],
            );

            $n++;
        }

        Sd::display_sd($json);
    }
}