Index.php 796 Bytes
<?php

use Action\AbstractAction;
use LibModels\Wap\Home\IndexData;
use Plugin\Helpers;

/**
 * 频道选择
 */
class IndexController extends AbstractAction
{

    /**
     * 启动首页频道选择
     */
    public function indexAction()
    {
        $data = array();

        // 背景图获取
        $banner = IndexData::getBannerStart();
        if($banner['code'] == 200)
        {
            foreach ($banner['data'] as $item) {
                foreach ($item['data']['list'] as $val) {
                    $data['background'] = Helpers::getImageUrl($val['src'], 640, 800, 1);
                }
            }
        }

        echo '<pre>';
        print_r($data);exit;

        $this->_view->assign('title', 'YOHO!有货');
        $this->_view->display('index', $data);
    }

}