Skip to content

Commit b0226dc

Browse files
committed
docs
1 parent 39dbdc3 commit b0226dc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/config/routetoclass.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44
* Generators
55
*
66
* An array of classes to use in generating body classes.
7+
*
8+
* Simply add a class which implements the following abstract class:
9+
* \Zschuessler\RouteToClass\Generators\GeneratorAbstract
10+
*
11+
* You can put this class anywhere you wish. As an example:
12+
* app/Providers/RouteToClass/Generators/MyCustomGeneratorName.php
13+
*
14+
* You may also interact with the RouteToClass provider directly instead, bypassing
15+
* the requirement for adding generators here. Note that doing this may lead to technical debt,
16+
* and that adding generators is the preferred method for long-term maintenance goals.
17+
*
18+
* Example of ad-hoc solution:
19+
*
20+
* ```
21+
* $routeToClassProvider = app()['route2class'];
22+
* $routeToClassProvider->addClass('test-class');
23+
* $routeToClassProvider->addClass(function() {
24+
* // Your own custom logic
25+
* return 'test-class-custom-logic';
26+
* });
27+
* ```
728
*/
829
'generators' => [
930
/**

0 commit comments

Comments
 (0)