本文整理汇总了PHP中wurl函数的典型用法代码示例。如果您正苦于以下问题:PHP wurl函数的具体用法?PHP wurl怎么用?PHP wurl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wurl函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: module_entries
function module_entries($name, $types = array(), $rid = 0, $args = null)
{
global $_W;
$ts = array('rule', 'cover', 'menu', 'home', 'profile', 'shortcut', 'function');
if (empty($types)) {
$types = $ts;
} else {
$types = array_intersect($types, $ts);
}
$fields = implode("','", $types);
$sql = 'SELECT * FROM ' . tablename('modules_bindings') . " WHERE `module`=:module AND `entry` IN ('{$fields}') ORDER BY eid ASC";
$pars = array();
$pars[':module'] = $name;
$bindings = pdo_fetchall($sql, $pars);
$entries = array();
foreach ($bindings as $bind) {
if (!empty($bind['call'])) {
load()->func('communication');
$response = ihttp_request($_W['siteroot'] . 'web/' . url('utility/bindcall', array('modulename' => $bind['module'], 'callname' => $bind['call'], 'args' => $args, 'uniacid' => $_W['uniacid'])), array('W' => base64_encode(iserializer($_W))));
if (is_error($response)) {
continue;
}
$response = json_decode($response['content'], true);
$ret = $response['message'];
if (is_array($ret)) {
foreach ($ret as $et) {
$et['url'] .= '&__title=' . urlencode($et['title']);
$entries[$bind['entry']][] = array('title' => $et['title'], 'url' => $et['url'], 'from' => 'call');
}
}
} else {
if ($bind['entry'] == 'cover') {
$url = wurl("platform/cover", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'menu') {
$url = wurl("site/entry", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'rule') {
$par = array('eid' => $bind['eid']);
if (!empty($rid)) {
$par['id'] = $rid;
}
$url = wurl("site/entry", $par);
}
if ($bind['entry'] == 'home') {
$url = murl("entry", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'profile') {
$url = murl("entry", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'shortcut') {
$url = murl("entry", array('eid' => $bind['eid']));
}
$entries[$bind['entry']][] = array('title' => $bind['title'], 'url' => $url, 'from' => 'define');
}
}
return $entries;
}
示例2: module_entries
function module_entries($name, $types = array(), $args = null)
{
$ts = array('rule', 'cover', 'menu', 'home', 'profile', 'shortcut', 'function');
if (empty($types)) {
$types = $ts;
} else {
$types = array_intersect($types, $ts);
}
$fields = implode("','", $types);
$sql = 'SELECT * FROM ' . tablename('modules_bindings') . " WHERE `module`=:module AND `entry` IN ('{$fields}') ORDER BY eid ASC";
$pars = array();
$pars[':module'] = $name;
$bindings = pdo_fetchall($sql, $pars);
$entries = array();
foreach ($bindings as $bind) {
if (!empty($bind['call'])) {
$site = WeUtility::createModuleSite($bind['module']);
$ret = @$site->{$bind}['call']($args);
if (is_array($ret)) {
foreach ($ret as $et) {
$et['url'] .= '&__title=' . urlencode($et['title']);
$entries[$bind['entry']][] = array('title' => $et['title'], 'url' => $et['url'], 'from' => 'call');
}
}
} else {
if ($bind['entry'] == 'cover') {
$url = wurl("platform/cover", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'menu') {
$url = wurl("site/entry", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'rule') {
$url = wurl("site/entry", array('eid' => $bind['eid'], 'id' => '{id}'));
}
if ($bind['entry'] == 'home') {
$url = murl("entry", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'profile') {
$url = murl("entry", array('eid' => $bind['eid']));
}
if ($bind['entry'] == 'shortcut') {
$url = murl("entry", array('eid' => $bind['eid']));
}
$entries[$bind['entry']][] = array('title' => $bind['title'], 'url' => $url, 'from' => 'define');
}
}
return $entries;
}
示例3: url
function url($segment, $params = array())
{
return wurl($segment, $params);
}
示例4: array
$shorts = array();
}
$shortcuts = array();
foreach ($shorts as $i => $shortcut) {
if (!empty($showmodules) && !in_array($shortcut['name'], $showmodules)) {
continue;
}
$module = $modules[$shortcut['name']];
if (!empty($module)) {
$shortcut['title'] = $module['title'];
if (file_exists('../addons/' . $module['name'] . '/icon.jpg')) {
$shortcut['image'] = '../addons/' . $module['name'] . '/icon.jpg';
} else {
$shortcut['image'] = '../web/resource/images/nopic-small.jpg';
}
$shortcut['link'] = wurl('home/welcome/ext', array('m' => $shortcut['name']));
$shortcuts[] = $shortcut;
}
}
unset($shortcut);
}
if ($do == 'platform') {
$title = '平台相关数据';
$sysmodules = system_modules();
$modules_other = array_diff(array_keys($modules), $sysmodules);
$settings = uni_setting($_W['uniacid'], array('stat'));
$day_num = !empty($settings['stat']['msg_maxday']) ? $settings['stat']['msg_maxday'] : 30;
if ($_W['ispost']) {
$m_name = trim($_GPC['m_name']);
$starttime = strtotime("-{$day_num} day");
$endtime = time();
示例5: createWebUrl
protected function createWebUrl($do, $query = array())
{
$query['do'] = $do;
$query['m'] = strtolower($this->modulename);
return wurl('project/module', $query);
}
示例6: doWebPtjmsg
public function doWebPtjmsg()
{
global $_W, $_GPC;
require_once 'sms.php';
$sms = json_decode($sms, true);
//var_dump($sms);
if ($_GPC['sms_account'] && $_GPC['sms_password']) {
$inithead = "<?php\n";
$filelocale = fopen(dirname(__FILE__) . "/sms.php", "w") or die('保存失败');
$model = $_GPC;
fwrite($filelocale, $inithead);
fclose($filelocale);
$dataSource = json_encode($model);
$data = '$sms=\'' . $dataSource . '\';';
$t = file_put_contents(dirname(__FILE__) . "/sms.php", $data, FILE_APPEND);
if ($t) {
$url = wurl('site/entry', array('eid' => $_GPC['eid']));
echo "<script>\r\n\t\t\tlocation.href='{$url}';\r\n\t\t\t</script>";
}
}
include $this->template('msg');
}
示例7: we7_refresh
private function we7_refresh()
{
$href = wurl('profile/module/setting', array('m' => $this->modulename));
echo "<script>location.href='{$href}';</script>";
}