euromark 11 years ago
parent
commit
f4c486f483
3 changed files with 94 additions and 86 deletions
  1. 2 83
      README.md
  2. 75 0
      docs/Install.md
  3. 17 3
      docs/README.md

+ 2 - 83
README.md

@@ -40,90 +40,9 @@ This plugin for the Cake 3 version also contains some 2.x shims to ease migratio
 - Model::$validate, Model::$primaryKey, Model::$displayField and Model relations as properties
 - Set/Multibyte class, Session component and a cut down version of JsHelper
 
-## How to include
-Installing the Plugin is pretty much as with every other CakePHP Plugin.
+## Docs
 
-Put the files in `ROOT/plugins/Tools`, using Packagist/Composer:
-```
-"require": {
-	"dereuromark/cakephp-tools": "dev-cake3"
-}
-```
-and
-
-	composer update
-
-Details @ https://packagist.org/packages/dereuromark/cakephp-tools
-
-This will load the plugin (within your boostrap file):
-```php
-Plugin::load('Tools');
-```
-or
-```php
-Plugin::loadAll();
-```
-
-In case you want the Tools bootstrap file included (recommended), you can do that in your `APP/Config/bootstrap.php` with
-
-```php
-Plugin::load('Tools', array('bootstrap' => true));
-```
-
-or
-
-```php
-Plugin::loadAll(array(
-		'Tools' => array('bootstrap' => true)
-));
-```
-
-## Namespacing
-Using Cake3 and namespaces, don't forget to add "Tools" as namespace to new files.
-Also don't forget the `use` statements.
-
-If you create a new behavior in the plugin, it might look like this:
-```php
-namespace Tools\Model\Behavior;
-
-use Cake\ORM\Behavior;
-
-class CoolBehavior extends Behavior {
-}
-```
-
-For a new APP behavior "MySlugged" that extends "Tools.Slugged" it is:
-```php
-namespace App\Model\Behavior;
-
-use Tools\Model\Behavior\SluggedBehavior;
-
-class MySluggedBehavior extends SluggedBehavior {
-}
-```
-Note that use statements should be in alphabetical order.
-See CakePHP coding standards for details.
-
-### Internal handling via plugin dot notation
-Internally (method access), you don't use the namespace declaration. The plugin name suffices:
-```php
-// In a Table
-$this->addBehavior('Tools.Slugged'); // Adding SluggedBehavior
-
-// In a Controller
-public $helpers = array('Tools.Foo'); // Adding FooHelper
-```
-
-## Testing
-You can test using a local installation of phpunit or the phar version of it:
-
-	cd Plugin/Tools
-	composer update
-	phpunit
-
-To test a specific file:
-
-	phpunit /path/to/class.php
+- [Documentation](docs/README.md)
 
 ### TODOs
 

+ 75 - 0
docs/Install.md

@@ -0,0 +1,75 @@
+# Installation
+
+## How to include
+Installing the Plugin is pretty much as with every other CakePHP Plugin.
+
+Put the files in `ROOT/plugins/Tools`, using Packagist/Composer:
+```
+"require": {
+	"dereuromark/cakephp-tools": "dev-cake3"
+}
+```
+and
+
+	composer update
+
+Details @ https://packagist.org/packages/dereuromark/cakephp-tools
+
+This will load the plugin (within your boostrap file):
+```php
+Plugin::load('Tools');
+```
+or
+```php
+Plugin::loadAll(...);
+```
+
+In case you want the Tools bootstrap file included (recommended), you can do that in your `ROOT/Config/bootstrap.php` with
+
+```php
+Plugin::load('Tools', array('bootstrap' => true));
+```
+
+or
+
+```php
+Plugin::loadAll(array(
+		'Tools' => array('bootstrap' => true)
+));
+```
+
+## Namespacing
+Using Cake3 and namespaces, don't forget to add "Tools" as namespace to new files.
+Also don't forget the `use` statements.
+
+If you create a new behavior in the plugin, it might look like this:
+```php
+namespace Tools\Model\Behavior;
+
+use Cake\ORM\Behavior;
+
+class CoolBehavior extends Behavior {
+}
+```
+
+For a new APP behavior "MySlugged" that extends "Tools.Slugged" it is:
+```php
+namespace App\Model\Behavior;
+
+use Tools\Model\Behavior\SluggedBehavior;
+
+class MySluggedBehavior extends SluggedBehavior {
+}
+```
+Note that use statements should be in alphabetical order.
+See CakePHP coding standards for details.
+
+### Internal handling via plugin dot notation
+Internally (method access), you don't use the namespace declaration. The plugin name suffices:
+```php
+// In a Table
+$this->addBehavior('Tools.Slugged'); // Adding SluggedBehavior
+
+// In a Controller
+public $helpers = array('Tools.Foo'); // Adding FooHelper
+```

+ 17 - 3
docs/README.md

@@ -5,13 +5,16 @@
 This cake3 branch only works for **CakePHP3.x** - please use the master branch for CakePHP 2.x!
 **It is still dev** (not even alpha), please be careful with using it.
 
-## Detailed Documentation - Quicklinks
-* [Passwordable](Passwordable.md)
-* ...
+## Installation
+* [Installation](Install.md)
 
 ## Upgrade Guide
 * [Upgrade guide from 2.x to 3.x](Upgrade.md)
 
+## Detailed Documentation - Quicklinks
+* [Passwordable](Passwordable.md)
+* ...
+
 ## Basic enhancements of the core
 
 ### Model
@@ -81,3 +84,14 @@ class AppController extends Controller {
 ```
 
 
+## Testing
+You can test using a local installation of phpunit or the phar version of it:
+
+	cd Plugin/Tools
+	composer update
+	phpunit
+
+To test a specific file:
+
+	phpunit /path/to/class.php
+