You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Shims.md
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,39 @@ use Tools\Controller\Controller;
33
33
34
34
class AppController extends Controller {
35
35
36
-
public $components = array('Shim.Session');
36
+
public $components = ['Shim.Session'];
37
37
38
38
}
39
39
```
40
40
It also contains the new `consume()` method.
41
+
42
+
43
+
## Helper
44
+
45
+
### Session
46
+
The session helper of the core is deprecated and will throw a warning as it will soon be removed.
47
+
Better use the plugin one right away. It is a 1:1 clone of it.
48
+
```php
49
+
namespace App\Controller;
50
+
51
+
use Tools\Controller\Controller;
52
+
53
+
class AppController extends Controller {
54
+
55
+
public $helpers = ['Shim.Session'];
56
+
57
+
}
58
+
```
59
+
It also contains the new `consume()` method.
60
+
61
+
### Configure
62
+
63
+
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.
64
+
Just make sure your controller (or AppView) loads the helper:
0 commit comments