PaginateViewHelper
class PaginateViewHelper extends AbstractWidgetViewHelper (View source)
This ViewHelper renders a Pagination of objects.
= Examples =
// use {paginatedBlogs} as you used {blogs} before, most certainly inside
// a loop.
```
// This example will display at the maximum 10 links and tries to the settings
// pagesBefore and pagesAfter into account to get the best result
```
= Performance characteristics =
In the above example, it looks like {blogs} contains all Blog objects, thus
you might wonder if all objects were fetched from the database.
However, the blogs are NOT fetched from the database until you actually use them,
so the paginate ViewHelper will adjust the query sent to the database and receive
only the small subset of objects.
So, there is no negative performance overhead in using the Paginate Widget.
Properties
protected ControllerContext
$controllerContext
Controller Context to use
from
AbstractViewHelper
protected ObjectManagerInterface
$objectManager
from
AbstractViewHelper
protected LoggerInterface
$logger
from
AbstractViewHelper
protected bool
$escapeOutput
from
AbstractWidgetViewHelper
protected PaginateController
$controller
protected bool
$ajaxWidget
If set to true, it is an AJAX widget.
from
AbstractWidgetViewHelper
protected bool
$storeConfigurationInSession
If set to false, this widget won't create a session (only relevant for AJAX widgets).
from
AbstractWidgetViewHelper
Methods
void
setRenderingContext(RenderingContextInterface $renderingContext)
No description
from
AbstractViewHelper
void
from
AbstractViewHelper
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
from
AbstractViewHelper
void
void
initializeArguments()
Initialize the arguments.
string
initializeArgumentsAndRender()
Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper.
void
setChildNodes(array $childNodes)
Stores the syntax tree child nodes in the Widget Context, so they can be
rendered with lateron.
array
getWidgetConfiguration()
Generate the configuration for this widget. Override to adjust.
array
getAjaxWidgetConfiguration()
Generate the configuration for this widget in AJAX context.
array
getNonAjaxWidgetConfiguration()
Generate the configuration for this widget in non-AJAX context.
string
initiateSubRequest()
Initiate a sub request to $this->controller. Make sure to fill $this->controller
via Dependency Injection.
void
resetState()
Resets the ViewHelper state by creating a fresh WidgetContext
string
compile(string $argumentsName, string $closureName, string $initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)
No description
string
render()
Render this view helper
Details
void
setRenderingContext(RenderingContextInterface $renderingContext)
No description
void
injectObjectManager(ObjectManagerInterface $objectManager)
No description
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
bool
isEscapingInterceptorEnabled()
No description
void
injectAjaxWidgetContextHolder(AjaxWidgetContextHolder $ajaxWidgetContextHolder)
No description
void
injectWidgetContext(WidgetContext $widgetContext)
No description
void
initializeArguments()
Initialize the arguments.
string
initializeArgumentsAndRender()
Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper.
void
setChildNodes(array $childNodes)
Stores the syntax tree child nodes in the Widget Context, so they can be
rendered with lateron.
protected array
getWidgetConfiguration()
Generate the configuration for this widget. Override to adjust.
protected array
getAjaxWidgetConfiguration()
Generate the configuration for this widget in AJAX context.
By default, returns getWidgetConfiguration(). Should become API later.
protected array
getNonAjaxWidgetConfiguration()
Generate the configuration for this widget in non-AJAX context.
By default, returns getWidgetConfiguration(). Should become API later.
protected string
initiateSubRequest()
Initiate a sub request to $this->controller. Make sure to fill $this->controller
via Dependency Injection.
void
resetState()
Resets the ViewHelper state by creating a fresh WidgetContext
string
compile(string $argumentsName, string $closureName, string $initializationPhpCode, ViewHelperNode $node, TemplateCompiler $compiler)
No description
string
render()
Render this view helper