gyro/modules/console/controller/base/renderdecorators/consolerenderdecorator.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Renders result of a controller action for console output 00004 * 00005 * This render decorator gets autmatically set, if you invoke 00006 * an action through the console. 00007 * 00008 * @author Gerd Riesselmann 00009 * @ingroup Console 00010 */ 00011 class ConsoleRenderDecorator extends DispatcherInvokeRenderDecorator { 00012 /** 00013 * Render page 00014 * 00015 * @param PageData $page_data 00016 * @param IRenderDecorator Decorator to invoke render_content upon 00017 * @param int $policy If set to IView::DISPLAY, content is printed, if false it is returned only 00018 * @return mixed 00019 */ 00020 public function render_page($page_data, $content_render_decorator, $policy = IView::NONE) { 00021 $view = ViewFactory::create_view(ViewFactoryConsole::PAGE_CONSOLE, $page_data->page_template, $page_data); 00022 $page_data->router->preprocess($page_data); 00023 $content_render_decorator->render_content($page_data); 00024 $page_data->router->postprocess($page_data); 00025 return $view->render($policy); 00026 } 00027 }