本文整理汇总了PHP中waSystem::getResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP waSystem::getResponse方法的具体用法?PHP waSystem::getResponse怎么用?PHP waSystem::getResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类waSystem
的用法示例。
在下文中一共展示了waSystem::getResponse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dispatch
public function dispatch()
{
$url = $this->system->getConfig()->getRequestUrl();
$url = preg_replace("!\\?.*\$!", '', $url);
$url = urldecode($url);
$r = $this->dispatchRoutes($this->getRoutes(), $url);
if (!$r || $r['url'] == '*' && $url && strpos(substr($url, -5), '.') === false && substr($url, -1) !== '/') {
$r2 = $this->dispatchRoutes($this->getRoutes(), $url . '/');
if ($r2 && (!$r || $r2['url'] != '*')) {
$this->system->getResponse()->redirect($this->system->getRootUrl() . $url . '/');
}
}
// if route found and app exists
if ($r && isset($r['app']) && $r['app'] && $this->system->appExists($r['app'])) {
$this->setRoute($r);
// dispatch app routes
$params = waRequest::param();
$u = $r['url'];
if (preg_match_all('/<([a-z_]+):?([^>]*)?>/ui', $u, $match, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
$offset = 0;
foreach ($match as $m) {
$v = $m[1][0];
$s = isset($params[$v]) ? $params[$v] : '';
$u = substr($u, 0, $m[0][1] + $offset) . $s . substr($u, $m[0][1] + $offset + strlen($m[0][0]));
$offset += strlen($s) - strlen($m[0][0]);
}
}
$this->root_url = self::clearUrl($u);
$url = substr($url, strlen($this->root_url));
$this->dispatchRoutes($this->getAppRoutes($r['app'], $r), $url);
}
return $r;
}
示例2: meta
public function meta($name, $value = null)
{
if ($value) {
$this->wa->getResponse()->setMeta($name, $value);
} else {
return $this->wa->getResponse()->getMeta($name);
}
}