Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
ApiController Class Reference

Public Member Functions

 actionPages ()

Detailed Description

Public API for retrieving information about remembered pages

Definition at line 7 of file ApiController.php.

Member Function Documentation

ApiController::actionPages ( )

Return RememberedPages in JSON format

All parameters added as GET parameter to query string

Filtering: RememberedPage[FIELD]=VALUE Set of filters can be specified Example: RememberedPage[collection_id]=1&RememberedPage[url]=goog

Sorting: Set RememberedPage_sort=FIELD_NAME[.SORT_DIRECTION] Only one sorting attribute can be specified Example: RememberedPage_sort=created OR RememberedPage_sort=created.desc

Pagination: Every response contains pagination data "pagination": { "itemCount": "21", "pageSize": 10, "pageCount": 3, "currentPage": 2 } It reflects current page number, current page size, total items, total pages. By Default first page is loaded. Page numeration starts from 1. For specifying some page add "page" parametr to query string Example: page=3

Definition at line 38 of file ApiController.php.

{
$rememberedPage = new RememberedPage('search');
if(isset($_GET['RememberedPage'])){
$rememberedPage->attributes = $_GET['RememberedPage'];
}
$dataProvider = $rememberedPage->search();
$pagination = $dataProvider->getPagination();
header('Content-type: application/json');
$response = array(
'data' => $dataProvider->getData(),
'pagination' => array(
'itemCount' => $pagination->getItemCount(),
'pageSize' => $pagination->getPageSize(),
'pageCount' => $pagination->getPageCount(),
'currentPage' => $pagination->getCurrentPage() + 1,
)
);
echo CJSON::encode($response);
die;
}

The documentation for this class was generated from the following file: