Example #1
0
        if (true === is_array($listCarousel) && count($listCarousel) > 0) {
            if (in_array($path . '/carousel-store.json', $listCarousel)) {
                $listCarousel = $path . '/carousel-store.json';
            } else {
                $listCarousel = '';
            }
        }
        if (empty($listCarousel)) {
            $content = "{\r\n}";
            $listCarousel = $carouselObj->createConfig(CAROUSEL_DIR, $content);
            //echo "carousel-store.json configuration file was not found on the system"; exit;
        }
        $content = $dirObj->readFile($listCarousel);
        $carouselList = json_decode($content, true);
        $carousels = $carouselObj->verifyExist($carouselList);
        $moreCarousels = $carouselObj->checkMoreCarosuel(CAROUSEL_DIR);
        $display['carousels'] = $carousels;
    }
    if (true === isset($formPosts[$id]['formComponents']) && true === is_array($formPosts[$id]['formComponents'])) {
        foreach ($formPosts[$id]['formComponents'] as $key => $val) {
            if (true === is_array($val)) {
                foreach ($val as $k => $v) {
                    $display = array_merge($display, array($key . "_" . $k => $v));
                }
            } else {
                $display = array_merge($display, array($key => $val));
            }
        }
    }
    return $app['twig']->render($id . '.twig', $display);
});