# RedirectToView.class.php

Go to the documentation of this file.

    00001 <?php
    00002 /***************************************************************************
    00003  *   Copyright (C) 2006-2008 by Konstantin V. Arkhipov                     *
    00004  *                                                                         *
    00005  *   This program is free software; you can redistribute it and/or modify  *
    00006  *   it under the terms of the GNU Lesser General Public License as        *
    00007  *   published by the Free Software Foundation; either version 3 of the    *
    00008  *   License, or (at your option) any later version.                       *
    00009  *                                                                         *
    00010  ***************************************************************************/
    00011
    00015     final class RedirectToView extends RedirectView
    00016     {
    00017         private $prefix = null;
    00018         private $suffix = null;
    00019
    00023         public static function create($controllerName)
    00024         {
    00025             return new self($controllerName);
    00026         }
    00027
    00028         public function __construct($controllerName)
    00029         {
    00030             Assert::classExists($controllerName);
    00031
    00032             $this->url = $controllerName;
    00033         }
    00034
    00035         public function getPrefix()
    00036         {
    00037             return $this->prefix;
    00038         }
    00039
    00043         public function setPrefix($prefix)
    00044         {
    00045             $this->prefix = $prefix;
    00046
    00047             return $this;
    00048         }
    00049
    00050         public function getSuffix()
    00051         {
    00052             return $this->suffix;
    00053         }
    00054
    00058         public function setSuffix($suffix)
    00059         {
    00060             $this->suffix = $suffix;
    00061
    00062             return $this;
    00063         }
    00064
    00065         public function getName()
    00066         {
    00067             return $this->url;
    00068         }
    00069
    00073         public function setName($name)
    00074         {
    00075             $this->url = $name;
    00076
    00077             return $this;
    00078         }
    00079
    00080         public function getUrl()
    00081         {
    00082             return $this->prefix.$this->url.$this->suffix;
    00083         }
    00084     }
    00085 ?>