<?php

/**
 * Class QR
 * @author Candison November <www.kandisheng.com>
 * @time   2017-07-11
 */
class QR extends MY_Controller
{
    /**
     * Index action
     * Get image data of QR code from House365 API server
     * @param void
     * @return bool
     */
    public function index()
    {
        $content = isset($_GET['text']) ? $_GET['text'] : '';
        $url = sprintf('http://api.house365.com/esf/web/ewm/?url=%s', urlencode($content));
        $result = file_get_contents($url);
        header('Content-Type:image/png');
        echo $result;
        return true;
    }
}