<?php
/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Eccube\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Routing\Annotation\Route;
class TopController extends AbstractController
{
/**
* @Route("/", name="homepage", methods={"GET"})
* @Template("index.twig")
*/
public function index()
{
require_once('../../wpsite/wp-load.php');
$args = array(
'post_status' => 'any',
'post_type' => 'aws-plan',
'orderby' => 'date',
'order' => 'DESC',
'numberposts' => '3',
);
$p_posts = get_posts( $args );
$array=[];
foreach($p_posts as $post) {
$array[] = array(
"id" => $post->ID,
"list_img" => get_field('list_img',$post->ID)['url'],
"title" => get_field('title_en',$post->ID),
"list_status" => get_field('list_status_en',$post->ID),
"list_text" => get_field('list_text_en',$post->ID),
);
}
return [
'WpPosts' => $array,
];
}
}