Ejemplo n.º 1
0
 /**
  * action resource
  *
  * @param string $identifier
  * @param integer $type
  * @param integer $uid
  * @return string
  */
 public function resourceAction($identifier, $type, $uid = NULL)
 {
     $resources = array();
     foreach ($this->resourceRepository->findForApi($identifier, $type, $uid) as $resource) {
         $resources[] = array('uid' => $resource->getUid(), 'sort' => $resource->getSort(), 'title' => $resource->getTitle(), 'url' => $resource->getUrl(), 'path' => str_replace('{baseurl}', $this->settings['baseUrl'], $resource->getPath()), 'content' => $resource->getContent());
     }
     return json_encode($resources);
 }