public function addAction() { $success = false; $errors = array(); if (!self::$_install && $this->request->data) { Model::connection()->read(self::$_sql); if (!($success = UsersController::addUser($this->request->data['user'], $this->request->data['password'], $errors))) { $errors['User'] = "******"; } if ($success && !($success = PostsController::addPost("Post example", self::$_lorem, $errors))) { $errors['Post'] = "Post can't be created."; } if ($success) { self::$_install = true; } } return compact('success', 'errors'); }