public function loadresourcesAction() { if ($this->getRequest()->isGet() && $this->_ajaxRequest) { $resourceService = new Service_Resource(); if (is_array($resources = $resourceService->fetchBookmarked($this->_user->id))) { $result['root'] = $resources; $this->_response->appendBody(Zend_Json::encode($result)); return; } else { $this->_response->appendBody('0'); return; } } else { return $this->_redirect('/profile'); } }