gyro/core/controller/base/renderdecorators/redirectactionrenderdecorator.cls.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * Redirect to given action 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup Controller 00007 * 00008 * @attention This class is not ready yet - don't use 00009 */ 00010 class RedirectActionRenderDecorator extends RenderDecoratorBase { 00011 /** 00012 * Url to redirect to 00013 * 00014 * @var string 00015 */ 00016 private $target_path = null; 00017 00018 /** 00019 * Constructor 00020 * 00021 * @param ICacheManager $cache_manager Desired Cache Manager 00022 * @return void 00023 */ 00024 public function __construct($target_path) { 00025 $this->target_path = $target_path; 00026 } 00027 00028 /** 00029 * Initialize this decorator and the data passed 00030 * 00031 * @param PageData $page_data 00032 * @return void 00033 */ 00034 public function initialize($page_data) { 00035 Url::current()->clear_query()->set_path($this->target_path)->redirect(Url::PERMANENT); 00036 exit; 00037 } 00038 }