Permalink
Browse files

Documentation update.

Signed-off-by: Adrian Jones <adrianj1998@hotmail.com>
  • Loading branch information...
1 parent a9d9fa0 commit ff167c81407886d63e56f67b0685a2d143b7cd4b @adrianj98 adrianj98 committed Oct 24, 2012
Showing with 57 additions and 7 deletions.
  1. +1 −4 core/base.php
  2. +15 −2 core/baseClass.class.php
  3. +35 −0 core/controller_base.class.php
  4. +6 −1 core/router.class.php
View
@@ -2,10 +2,7 @@
/**
*
- * User: Adrian
- * Date: Mar 11, 2011
- * Time: 4:18:23 PM
- * To change this template use File | Settings | File Templates.
+ * @package DCore/core
*/
define('DIRECTORY_SEPARATOR', '/');
require_once __FRAMEWORK_PATH . 'baseClass.class.php';
View
@@ -3,6 +3,9 @@
/**
* Most classes inherit from baseClass
*
+ * base classes main purpose is to hold a pointer to the registry and options for that
+ * class
+ *
* @version $Id$
* @copyright 2009
* @package DCore/core
@@ -13,13 +16,23 @@ class baseClass {
* @var Registry
*/
public $registry;
-
+ public $options;
+ /**
+ * modules and plugins are assumed to have a init() function. They are usually
+ * called after all others are loaded
+ *
+ */
public function init() {
}
-
+ /** standard construct or that should be called by inherited calsses
+ *
+ * @param registry $registry
+ * @param mixed $options
+ */
function __construct($registry, $options = null) {
$this->registry = $registry;
+ $this->options = $options;
}
}
@@ -2,6 +2,41 @@
/**
* abstract class all controllers are extended from including rest controllers
+ * this is a super simple controler base class. All controllers must have a
+ * index() function.
+ *
+ * functions that end with Action are the only functions can be called as an action
+ * from the router.
+ *
+ * <code>
+ *
+ * class myController extends baseClass {
+ *
+ * function index()
+ * {
+ * //the function called if no action is defined
+ * }
+ *
+ * function viewAction()
+ * {
+ * // the action called when "view" action is called
+ * // such as http://mydoomain.com/my/view
+ * }
+ * }
+ *
+ * </code>
+ *
+ * Controlers are usually registered in the plugin setup init.php. but can be registered
+ * anywhere before $router->loader() is called
+ *
+ * <code>
+ *
+ * $registry->router->setController('my1','my2:my3')
+ *
+ * </code>
+ *
+ * this would set class my3Controller class in plugin "my2' as controller for url my1
+ * such as http://mydoomain.com/my1/view
*
* @package DCore/core
*/
View
@@ -86,7 +86,12 @@ function setPath($path) {
function setController($controllerName, $controllerLocal) {
$this->Controllers[$controllerName] = $controllerLocal;
}
-
+/**
+ * Dummy function when not making a REST request
+ *
+ * @param type $class
+ * @param type $basePath
+ */
public function addService($class, $basePath = '') {
}

0 comments on commit ff167c8

Please sign in to comment.