Perforce Chronicle 2012.2/486814
API Documentation

Widget_View_Helper_Region Class Reference

View helper that renders a region using a specified template. More...

List of all members.

Public Member Functions

 region ($region, $template= 'region.phtml')
 Render the named/given region.

Detailed Description

View helper that renders a region using a specified template.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

Widget_View_Helper_Region::region ( region,
template = 'region.phtml' 
)

Render the named/given region.

Parameters:
string$regionthe id of a region to render.
string$templatethe template to use.
Returns:
string the rendered region output.
    {
        $view          = $this->view;
        $view->region  = $region;
        $view->widgets = P4Cms_Widget::fetchByRegion($region);

        // tag the page cache so it can be appropriately cleared later
        if (P4Cms_Cache::canCache('page')) {
            P4Cms_Cache::getCache('page')->addTag('p4cms_region_'      . bin2hex($region));
        }

        // make the widget context available to the view
        $widgetContext = new P4Cms_Controller_Action_Helper_WidgetContext;
        $view->widgetContext = $widgetContext->getEncodedValues();

        return $view->render($template);
    }

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