Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3769786
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/includes/controller/Controller.php b/includes/controller/Controller.php
index 8b570c5..33b1aad 100644
--- a/includes/controller/Controller.php
+++ b/includes/controller/Controller.php
@@ -1,57 +1,65 @@
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Controller class
*
* @package ObsidianWorkspaces
* @subpackage Controller
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*/
/**
* Controller class
*
* This class describes a controller
*/
abstract class Controller implements RunnableWithContext {
/**
* @var string the application name
*/
public static $name;
/**
* @var Context the site context
*/
public $context;
/**
* Initializes the controller resources
*/
public function initialize () { }
/**
* Handles a web request
*/
public abstract function handleRequest();
+ /**
+ * Loads a new instance of a Controller class
+ *
+ * @param Context the site or application context
+ * @return Controller an instance of the class inheriting from Controller
+ */
public static function load (Context $context) {
$controller = new static;
$controller->context = $context;
$controller->initialize();
return $controller;
}
/**
* Initializes a new instance of the controller with the specified context and handle request
+ *
+ * @param Context the site or application context
*/
public static function run (Context $context) {
static::load($context)->handleRequest();
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 16:54 (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260604
Default Alt Text
(1 KB)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment