|
30 | 30 | | Require all Leaf API's Files |
31 | 31 | | |
32 | 32 | */ |
33 | | -require __DIR__. "/Config/bootstrap.php"; |
| 33 | +require __DIR__ . "/Config/bootstrap.php"; |
34 | 34 |
|
35 | 35 | /* |
36 | 36 | |-------------------------------------------------------------------------- |
37 | | -| Initialise Leaf Core |
| 37 | +| Initialise Shortcut Functions |
38 | 38 | |-------------------------------------------------------------------------- |
39 | 39 | | |
40 | | -| Plant a seed, grow the stem and return Leaf🤷 |
| 40 | +| Simple functions you can call from anywhere in your application. |
| 41 | +| This is not a core feature, you can remove it and your app would still |
| 42 | +| work fine. |
41 | 43 | | |
42 | 44 | */ |
43 | | -$app = new Leaf\App; |
| 45 | +require __DIR__ . "/Config/functions.php"; |
44 | 46 |
|
45 | 47 | /* |
46 | 48 | |-------------------------------------------------------------------------- |
47 | | -| Default fix for CORS |
| 49 | +| Attach blade view |
48 | 50 | |-------------------------------------------------------------------------- |
49 | 51 | | |
50 | | -| This just prevents the connection client from throwing |
51 | | -| CORS errors at you. |
| 52 | +| Since blade no longer ships with Leaf by default, we |
| 53 | +| can attach blade back to Leaf so you can use Leaf MVC |
| 54 | +| as you've always used it. |
52 | 55 | | |
53 | 56 | */ |
54 | | -$app->evadeCors(false); |
| 57 | +Leaf\View::attach(\Leaf\Blade::class); |
55 | 58 |
|
56 | 59 | /* |
57 | 60 | |-------------------------------------------------------------------------- |
58 | | -| Error Configuration |
| 61 | +| Initialise Leaf Core |
59 | 62 | |-------------------------------------------------------------------------- |
60 | 63 | | |
61 | | -| Show or hide errors for easy debugging |
62 | | -| You might want to set this to false for production |
| 64 | +| Plant a seed, grow the stem and return Leaf🤷 |
63 | 65 | | |
64 | 66 | */ |
65 | | -Config\App::error_debug(true); |
| 67 | +$app = new Leaf\App(AppConfig()); |
66 | 68 |
|
67 | 69 | /* |
68 | 70 | |-------------------------------------------------------------------------- |
69 | | -| Initialise Shortcut Functions |
| 71 | +| Default fix for CORS |
70 | 72 | |-------------------------------------------------------------------------- |
71 | 73 | | |
72 | | -| Simple functions you can call from anywhere in your application. |
73 | | -| This is not a core feature, you can remove it and your app would still |
74 | | -| work fine. |
| 74 | +| This just prevents the connection client from throwing |
| 75 | +| CORS errors at you. |
75 | 76 | | |
76 | 77 | */ |
77 | | -require __DIR__ . "/Config/functions.php"; |
| 78 | +$app->evadeCors(false); |
78 | 79 |
|
79 | 80 | /* |
80 | 81 | |-------------------------------------------------------------------------- |
|
84 | 85 | | Require app routes. |
85 | 86 | | |
86 | 87 | */ |
87 | | -require __DIR__. "/App/Routes/index.php"; |
88 | | - |
| 88 | +require __DIR__ . "/App/Routes/index.php"; |
89 | 89 |
|
90 | 90 | /* |
91 | 91 | |-------------------------------------------------------------------------- |
|
0 commit comments