Browse Source

Add docs and missing property definition.

mark_story 11 years ago
parent
commit
edcef5b6a5
2 changed files with 18 additions and 1 deletions
  1. 15 0
      src/Controller/Controller.php
  2. 3 1
      src/Model/ModelAwareTrait.php

+ 15 - 0
src/Controller/Controller.php

@@ -89,6 +89,8 @@ class Controller implements EventListener {
 /**
  * The name of this controller. Controller names are plural, named after the model they manipulate.
  *
+ * Set automatically using conventions in Controller::__construct().
+ *
  * @var string
  * @link http://book.cakephp.org/2.0/en/controllers.html#controller-attributes
  */
@@ -216,8 +218,21 @@ class Controller implements EventListener {
 	public $methods = array();
 
 /**
+ * The path to this controllers view templates.
+ * Example `Articles`
+ *
+ * Set automatically using conventions in Controller::__construct().
+ *
+ * @var string
+ */
+	public $viewPath;
+
+/**
  * Constructor.
  *
+ * Sets a number of properties based on conventions if they are empty. To override the
+ * conventions CakePHP uses you can define properties in your class declaration.
+ *
  * @param \Cake\Network\Request $request Request object for this controller. Can be null for testing,
  *  but expect that features that use the request parameters will not work.
  * @param \Cake\Network\Response $response Response object for this controller.

+ 3 - 1
src/Model/ModelAwareTrait.php

@@ -29,7 +29,9 @@ trait ModelAwareTrait {
  * This object's primary model class name. Should be a plural form.
  * CakePHP will not inflect the name.
  *
- * Example: For a object named 'Comments', the modelClass would be 'Comments'
+ * Example: For a object named 'Comments', the modelClass would be 'Comments'.
+ * Plugin classes should use `Plugin.Comments` style names to correctly load
+ * models from the correct plugin.
  *
  * @var string
  */