Orion PHP  0.11.12
The PHP5.3 framework
menuentry.php
Go to the documentation of this file.
00001 <?php
00002 namespace Orion\Core;
00003 
00004 /**
00005  * \Orion\Core\MenuEntry
00006  * 
00007  * Orion MenuEntry class.
00008  * Ease menu and links creation and storage
00009  *
00010  * @author Thibaut Despoulain
00011  * @license BSD 4-clauses
00012  * @version 0.11.12
00013  */
00014 class MenuEntry
00015 {
00016     /**
00017      * Link's text
00018      * @var string
00019      */
00020     public $text=null;
00021     /**
00022      * Target module's name
00023      * @var string
00024      */
00025     public $module=null;
00026     /**
00027      * Target module's sub URI
00028      * @var string
00029      */
00030     public $route=null;
00031     /**
00032      * Target module's mode
00033      * @var string
00034      */
00035     public $mode=null;
00036 
00037     /**
00038      * Creates a new menu entry for the configuration file
00039      * @param string $_text Link text
00040      * @param string $_module Module url wih the extension (ex: home.o)
00041      * @param string $_route Extra routing (ex: /page/2)
00042      */
00043     public function  __construct($_text, $_module, $_route=null, $_mode=null)
00044     {
00045         $this->text = $_text;
00046         $this->module = $_module;
00047         $this->route = $_route;
00048         $this->mode = $_mode;
00049     }
00050     
00051     /**
00052      * Generates and returns corresponding URL
00053      * @return string
00054      */
00055     public function getURL()
00056     {
00057         return Context::genModuleURL($this->module, $this->route, $this->mode);
00058     }
00059 }
00060 ?>