本文整理汇总了PHP中Output::Json方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::Json方法的具体用法?PHP Output::Json怎么用?PHP Output::Json使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output::Json方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json
function json($data, $type = 'eval')
{
$type = strtolower($type);
$allow = array('eval', 'alert', 'updater', 'dialog', 'mix', 'refresh');
if (false == in_array($type, $allow)) {
return false;
}
Output::Json(array('data' => $data, 'type' => $type));
}
示例2: json
function json($data, $type = 'eval')
{
$type = strtolower($type);
$allow = array('eval', 'alert', 'right', 'notice', 'sucsses');
if (false == in_array($type, $allow)) {
return false;
}
Output::Json(array('data' => $data, 'type' => $type));
}
示例3: user_email
function user_email()
{
$email = $this->_request("v");
$users = D("CmsUsers")->getByEmail($email);
if ($users) {
Output::Json(null, 1);
} else {
Output::Json(0);
}
}
示例4: check_email
function check_email()
{
$v = $this->_request("v");
$user_id = $this->_request("n");
$user_id = str_replace("id-", "", $user_id);
$u = M("Users")->getByEmail($v);
if (empty($u) || $u['id'] == $user_id) {
Output::Json(0);
} else {
Output::Json(null, 1);
}
}
示例5: array
$o = array();
$o['id'] = $one['id'];
$o['link'] = "{$si['site_url']}/team.php?id={$one['id']}";
$o['large_image_url'] = team_image($one['image']);
$o['small_image_url'] = team_image($one['image'], true);
$o['title'] = $one['title'];
$o['product'] = $one['product'];
$o['team_price'] = $one['team_price'];
$o['market_price'] = $one['market_price'];
$o['rebate'] = team_discount($one);
$o['start_date'] = date('c', $one['begin_time']);
$o['end_date'] = date('c', $one['end_time']);
$o['state'] = $one['state'];
$o['tipped'] = $one['reach_time'] > 0;
$o['tipped_date'] = date('c', $one['reach_time']);
$o['tipping_point'] = abs(intval($one['min_number']));
$o['current_point'] = abs(intval($one['now_number']));
$co = array();
$co['limited_quantity'] = $one['per_number'] > 0;
$co['maximum_purchase'] = abs(intval($one['per_number']));
$co['expiration_date'] = date('c', $one['expire_time']);
$o['conditions'] = $co;
$o['city'] = $city['name'];
$o['group'] = $group['name'];
$oa[$one['id']] = $o;
}
$o = array('site' => $si, 'teams' => $oa);
//if ('json'===strtolower(strval($_GET['s'])))
Output::Json($o);
//header('Content-Type: application/xml; charset=UTF-8');
//Output::Xml($o);
示例6: dirname
<?php
require_once dirname(dirname(__FILE__)) . '/app.php';
cookieset('newbie', 'N');
Output::Json(0);
示例7: array
$city = $cityList[$one['city']];
$group = $city;
$o = array();
$o['pid'] = $one['id'];
$o['url'] = "{$si['url']}/?view={$one['id']}";
$o['image_large'] = imager($one['img']);
$o['image_small'] = imager($one['img'], IMG_Small);
$o['title'] = $one['name'];
$o['intro'] = $one['intro'];
$o['now_price'] = $one['nowprice'];
$o['price'] = $one['price'];
$o['discount'] = $one['discount'];
$o['begin_date'] = date('Y-m-d H:i:s', $one['begintime']);
$o['finish_date'] = date('Y-m-d H:i:s', $one['overtime']);
$o['status'] = $one['status'];
$co = array();
$co['maximum'] = abs(intval($one['oncemax']));
$co['deadline'] = date('Y-m-d H:i:s', $one['perioddate']);
$o['conditions'] = $co;
$o['city'] = $city;
$oa[$one['id']] = $o;
}
$o = array( 'site' => $si, 'products' => $oa );
if (ENC_IS_GBK) $o = array_iconv('GBK', 'UTF-8', $o);
if ('json'===strtolower(strval($_GET['s']))) Output::Json($o);
header('Content-Type: application/xml; charset=UTF-8');
Output::Xml($o);
?>