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
@@ -90,6 +91,25 @@ class LoginController extends ShieldLogin
90
91
}
91
92
```
92
93
94
+
## Integrating Custom View Libraries
95
+
96
+
If your application uses a different method to convert view files to HTML than CodeIgniter's built-in `view()` helper you can easily integrate your system anywhere that a view is rendered within Shield. All controllers and actions use the `CodeIgniter\Shield\Traits\Viewable` trait which provides a simple `renderView()` method that takes the same arguments as the `view()` helper. This allows you to extend the Action or Controller and only change the single method of rendering the view, leaving all of the logic untouched so your app will not need to maintain Shield logic when it doesn't need to change it.
97
+
98
+
```php
99
+
use Acme\Themes\Traits\Themeable;
100
+
use CodeIgniter\Shield\Controllers\LoginController;
101
+
102
+
class MyLoginController extends LoginController
103
+
{
104
+
use Themable;
105
+
106
+
protected function view(string $view, array $data=[], array $options=[])
107
+
{
108
+
return $this->themedView($view, $data, $options);
109
+
}
110
+
}
111
+
```
112
+
93
113
## Custom Validation Rules
94
114
95
115
### Registration
@@ -149,7 +169,7 @@ Similar to the process for validation rules in the **Registration** section, you
0 commit comments