|
|
@@ -1,7 +1,6 @@
|
|
|
# CakePHP Tools Plugin
|
|
|
[](https://travis-ci.org/dereuromark/cakephp-tools)
|
|
|
[](https://codecov.io/github/dereuromark/cakephp-tools?branch=2.x)
|
|
|
-[](https://packagist.org/packages/dereuromark/cakephp-tools)
|
|
|
[](https://php.net/)
|
|
|
[](https://packagist.org/packages/dereuromark/cakephp-tools)
|
|
|
[](https://packagist.org/packages/dereuromark/cakephp-tools)
|
|
|
@@ -36,15 +35,15 @@ That's it. It should be up and running.
|
|
|
In case you want the Tools bootstrap file included (recommended), you can do that in your `APP/Config/bootstrap.php` with
|
|
|
|
|
|
```php
|
|
|
-CakePlugin::load('Tools', array('bootstrap' => true));
|
|
|
+CakePlugin::load('Tools', ['bootstrap' => true]);
|
|
|
```
|
|
|
|
|
|
For `CakePlugin::loadAll()` it's
|
|
|
|
|
|
```php
|
|
|
-CakePlugin::loadAll(array(
|
|
|
- 'Tools' => array('bootstrap' => true)
|
|
|
-));
|
|
|
+CakePlugin::loadAll([
|
|
|
+ 'Tools' => ['bootstrap' => true]
|
|
|
+]);
|
|
|
```
|
|
|
|
|
|
MyModel can be extended to use more powerful validation and other improvements:
|
|
|
@@ -102,12 +101,14 @@ For a quick reference or some larger modules see the [Tools Plugin Wiki](https:/
|
|
|
For including components, helper and behaviors you don't need App::uses() calls.
|
|
|
So for a pretty standard CakePHP app with some Tools plugin enhancements, the AppController could look like this:
|
|
|
```php
|
|
|
-public $components = array(
|
|
|
- 'Session', 'RequestHandler', 'Tools.Common', 'Auth');
|
|
|
-
|
|
|
-public $helpers = array(
|
|
|
- 'Session', 'Html', 'Form' => array('className' => 'Tools.FormExt'),
|
|
|
- 'Tools.Common', 'Tools.Format', 'Tools.Datetime', 'Tools.Numeric');
|
|
|
+public $components = [
|
|
|
+ 'Session', 'RequestHandler', 'Tools.Common', 'Auth'
|
|
|
+];
|
|
|
+
|
|
|
+public $helpers = [
|
|
|
+ 'Session', 'Html', 'Form' => ['className' => 'Tools.FormExt'],
|
|
|
+ 'Tools.Common', 'Tools.Format', 'Tools.Datetime', 'Tools.Numeric'
|
|
|
+];
|
|
|
```
|
|
|
|
|
|
## The cool stuff
|