|
|
@@ -33,8 +33,39 @@ use Tools\Controller\Controller;
|
|
|
|
|
|
class AppController extends Controller {
|
|
|
|
|
|
- public $components = array('Shim.Session');
|
|
|
+ public $components = ['Shim.Session'];
|
|
|
|
|
|
}
|
|
|
```
|
|
|
It also contains the new `consume()` method.
|
|
|
+
|
|
|
+
|
|
|
+## Helper
|
|
|
+
|
|
|
+### Session
|
|
|
+The session helper of the core is deprecated and will throw a warning as it will soon be removed.
|
|
|
+Better use the plugin one right away. It is a 1:1 clone of it.
|
|
|
+```php
|
|
|
+namespace App\Controller;
|
|
|
+
|
|
|
+use Tools\Controller\Controller;
|
|
|
+
|
|
|
+class AppController extends Controller {
|
|
|
+
|
|
|
+ public $helpers = ['Shim.Session'];
|
|
|
+
|
|
|
+}
|
|
|
+```
|
|
|
+It also contains the new `consume()` method.
|
|
|
+
|
|
|
+### Configure
|
|
|
+
|
|
|
+If you have a lot of `Configure::read()` calls in your layout and templates you can either manually include the use statement everywhere, put a class_alias() hack in your bootstrap or just quickly replace the calls with `$this->Configure->read()` as helper call.
|
|
|
+Just make sure your controller (or AppView) loads the helper:
|
|
|
+```php
|
|
|
+// Controller way
|
|
|
+public $helpers = ['Shim.Configure'];
|
|
|
+
|
|
|
+// AppView way
|
|
|
+$this->loadHelper('Shim.Configure');
|
|
|
+```
|