PageRender class

Adds a render method to Page, as used by the PageView Process.

This module is also able to cache page renders. It hooks into Pages and Fieldtypes to ensure cache files are cleaned/deleted when pages are saved/deleted.


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the PageRender class also inherits all the methods and properties of: WireData and Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
PageRender::beforeRenderPage(HookEvent $event)
NoneHook called before any other hooks to Page::render 
PageRender::clearCacheFile(HookEvent $event)
NoneHook to clear the cache file after a Pages::save or Pages::delete call 
PageRender::clearCacheFileAll(Page $page)
NoneClear all cached pages
PageRender::clearCacheFilePages(PageArray $items, Page $page)
NoneClear cache for multiple pages by ID
PageRender::getCacheFile($page)
CacheFileGet a CacheFile object corresponding to this Page 
PageRender::isCacheAllowed(Page $page)
boolIs the page render cache allowed for this request? 
PageRender::renderField(Page $page, string $fieldName)
string mixedRenders a field value 
PageRender::renderPage(HookEvent $event)
NoneReturn a string with the rendered output of this Page from its template file (other usages available as well)
PageRender::setPropertyPage(Page $page)
NoneSet page for get() properties / field rendering 

For hooks

These methods are only useful for hooking and should not be called directly.

Additional methods and properties

In addition to the methods and properties above, PageRender also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.251