public function attachEvents() { foreach (Memory::get(ACTION) as $namespace => $action) { $this->attachActionEvents($action, $namespace); } foreach (Memory::get(VIEW) as $namespace => $view) { $this->attachViewEvents($view, $namespace); } }
public function redirect($location, array $args = []) { if (false === stripos($location, '/')) { $url = new UrlHelper(); $url->setArguments(array_merge(['url' => $location], $args)); $location = $url->render(); } Memory::get(HTTP)->set(HEADER, ['Location' => $location]); Memory::get(HTTP)->set(CODE, 302); Memory::events()->emit(END, ['content' => '']); Memory::events()->emit(STOP); }
public function getCacheDir() { return Memory::get(SCOPE)->get(CACHE, false) ?: Memory::get(SCOPE)->get(BASE) . DS . CACHE . DS; }