public function getBaseUri($action = null) { $uri = $this->instanceId ? \Kiki\Router::getBaseUri('account', $this->instanceId) : \Kiki\Config::$kikiPrefix . "/account"; if (!empty($action)) { if ($uri[strlen($uri) - 1] != '/') { $uri .= "/"; } $uri .= $action; } return $uri; }
public function url($addSchema = false) { $sectionBaseUri = $this->sectionId ? \Kiki\Router::getBaseUri($this->sectionId) : null; if (!$sectionBaseUri) { $sectionBaseUri = "/"; } // TODO: support HTTPS $urlPrefix = ($addSchema ? "https" : null) . "//" . $_SERVER['SERVER_NAME']; // TODO: what if - unlikely, but possible, we have an Article (not Page) with cname index? Really time to go Post/Article/Page $url = $urlPrefix . $sectionBaseUri . ($this->cname != 'index' ? $this->cname : null); return $url; }