src/Application.php
public function __async_collection($navigationId = '0', $search = '0', $page = 1)
    {
        // Save pager size in session
        if (isset($_GET['pagerSize'])) {
            $_SESSION['pagerSize'] = str_replace('/', '', $_GET['pagerSize']);
            // delete get parameter from pager links
            unset($_GET['pagerSize']);
        }

        // Save search filter
        if (isset($_GET['search'])) {
            $_SESSION['search'] = str_replace('/', '', $_GET['search']);
            $search = str_replace('/', '', $_GET['search']);
            unset($_GET['search']);
        }

        // Set filtration info
        $navigationId = isset($navigationId) ? $navigationId : '0';
        $search = !empty($search) ? urldecode($search) : 0;
        $page = isset($page) ? $page : 1;


        // Create pager for material collection
        $pager = new Pager(
            $page,
            isset($_SESSION['pagerSize']) ? $_SESSION['pagerSize'] : $this->pageSize, $this->id . '/' . self::VIEW_TABLE_NAME . '/' . $navigationId . '/' . $search
        );

        // Create material collection
        $collection = new $this->collectionClass($this, new dbQuery(), $pager);

        // Add navigation filter
        if (isset($navigationId) && !empty($navigationId)) {
            $collection = $collection->navigation(array($navigationId));
        }

        return array_merge(
            array(
                'status' => true,
                'navigationId' => $navigationId,
                'searchQuery' => $search,
                'pageNumber' => $page,
                'rowsCount' => $collection->search($search)->fill()->getSize()
            ),
            $collection
                ->search($search)
				->fill()
                ->toView(self::VIEW_TABLE_NAME . '_')
        );
    }
public function __async_collection($navigationId = '0', $search = '0', $page = 1)
    {
        // Save pager size in session
        if (isset($_GET['pagerSize'])) {
            $_SESSION['pagerSize'] = str_replace('/', '', $_GET['pagerSize']);
            // delete get parameter from pager links
            unset($_GET['pagerSize']);
        }

        // Save search filter
        if (isset($_GET['search'])) {
            $_SESSION['search'] = str_replace('/', '', $_GET['search']);
            $search = str_replace('/', '', $_GET['search']);
            unset($_GET['search']);
        }

        // Set filtration info
        $navigationId = isset($navigationId) ? $navigationId : '0';
        $search = !empty($search) ? urldecode($search) : 0;
        $page = isset($page) ? $page : 1;


        // Create pager for material collection
        $pager = new Pager(
            $page,
            isset($_SESSION['pagerSize']) ? $_SESSION['pagerSize'] : $this->pageSize, $this->id . '/' . self::VIEW_TABLE_NAME . '/' . $navigationId . '/' . $search
        );

        // Create material collection
        $collection = new $this->collectionClass($this, new dbQuery(), $pager);

        // Add navigation filter
        if (isset($navigationId) && !empty($navigationId)) {
            $collection = $collection->navigation(array($navigationId));
        }

        return array_merge(
            array(
                'status' => true,
                'navigationId' => $navigationId,
                'searchQuery' => $search,
                'pageNumber' => $page,
                'rowsCount' => $collection->search($search)->fill()->getSize()
            ),
            $collection
                ->search($search)
				->fill()
                ->toView(self::VIEW_TABLE_NAME . '_')
        );
    }
public function __async_collection ( $ navigationId = '0' , $ search = '0' , $ page = 1 ) { // Save pager size in session if ( isset ( $ _GET [ 'pagerSize' ] ) ) { $ _SESSION [ 'pagerSize' ] = str_replace ( '/' , '' , $ _GET [ 'pagerSize' ] ) ; // delete get parameter from pager links unset ( $ _GET [ 'pagerSize' ] ) ; } // Save search filter if ( isset ( $ _GET [ 'search' ] ) ) { $ _SESSION [ 'search' ] = str_replace ( '/' , '' , $ _GET [ 'search' ] ) ; $ search = str_replace ( '/' , '' , $ _GET [ 'search' ] ) ; unset ( $ _GET [ 'search' ] ) ; } // Set filtration info $ navigationId = isset ( $ navigationId ) ? $ navigationId : '0' ; $ search = ! empty ( $ search ) ? urldecode ( $ search ) : 0 ; $ page = isset ( $ page ) ? $ page : 1 ; // Create pager for material collection $ pager = new Pager ( $ page , isset ( $ _SESSION [ 'pagerSize' ] ) ? $ _SESSION [ 'pagerSize' ] : $ this -> pageSize , $ this -> id . '/' . self :: VIEW_TABLE_NAME . '/' . $ navigationId . '/' . $ search ) ; // Create material collection $ collection = new $ this -> collectionClass ( $ this , new dbQuery ( ) , $ pager ) ; // Add navigation filter if ( isset ( $ navigationId ) && ! empty ( $ navigationId ) ) { $ collection = $ collection -> navigation ( array ( $ navigationId ) ) ; } return array_merge ( array ( 'status' => true , 'navigationId' => $ navigationId , 'searchQuery' => $ search , 'pageNumber' => $ page , 'rowsCount' => $ collection -> search ( $ search ) -> fill ( ) -> getSize ( ) ) , $ collection -> search ( $ search ) -> fill ( ) -> toView ( self :: VIEW_TABLE_NAME . '_' ) ) ; }
Render materials list with pager

@param string $navigationId Structure identifier
@param string $search Keywords to filter table
@param int $page Current table page
@return array Asynchronous response containing status and materials list with pager on success
or just status on asynchronous controller failure
Render materials list with pager