protected function getRoutes() { $routes = wa()->getRouting()->getByApp($this->getAppId()); $result = array(); $domain = siteHelper::getDomain(); if (isset($routes[$domain])) { foreach ($routes[$domain] as $route_id => $route) { $route['_id'] = $route_id; $route['_domain'] = $domain; $route['_url'] = waRouting::getUrlByRoute($route, $domain); $route['_url_title'] = $domain . '/' . waRouting::clearUrl($route['url']); $result[] = $route; } } return $result; }
protected function getRoutes($all = false) { $routes = wa()->getRouting()->getByApp($this->getAppId()); $result = array(); foreach ($routes as $d => $domain_routes) { foreach (array_reverse($domain_routes, true) as $route_id => $route) { $route['_id'] = $route_id; $route['_domain'] = $d; $route['_url'] = waRouting::getUrlByRoute($route, $d); $route['_url_title'] = $d . '/' . waRouting::clearUrl($route['url']); $result[] = $route; } } return $result; }
public function getUrlByRoute($route) { return $this->routing->getUrlByRoute($route, $this->domain); }