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

Public Member Functions

 getCurrentPage ($recalculate=true)

Public Attributes

 $contentId

Protected Member Functions

 createPageUrl ($page)

Detailed Description

Created by JetBrains PhpStorm. User: Andrey Date: 1/17/14 Time: 1:01 PM To change this template use File | Settings | File Templates.

Definition at line 10 of file CommentLinkPager.php.

Member Function Documentation

CommentLinkPager::createPageUrl (   $page)
protected

Creates the URL suitable for pagination.

Parameters
integer$pagethe page that the URL should point to.
Returns
string the created URL
See Also
CPagination::createPageUrl

Definition at line 19 of file CommentLinkPager.php.

{
$url = Yii::app()->request->getUrl();
$name = "clw{$this->contentId}";
$newParam = "clw{$this->contentId}=$page";
if (($oldValue = Yii::app()->request->getParam($name)) !== null) {
$url = str_replace("$name=$oldValue", $newParam, $url);
} else {
if (strpos($url, '?') !== false) {
$url .= '&' . $newParam;
} else {
$url .= '?' . $newParam;
}
}
$url .= '#list_' . $this->contentId;
return $url;
}
CommentLinkPager::getCurrentPage (   $recalculate = true)
Parameters
boolean$recalculatewhether to recalculate the current page based on the page size and item count.
Returns
integer the zero-based index of the current page. Defaults to 0.
See Also
CPagination::getCurrentPage

Definition at line 43 of file CommentLinkPager.php.

{
return Yii::app()->request->getParam("clw{$this->contentId}", 0);
}

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