|
19 | 19 | | Composer provides a convenient, automatically generated class loader |
20 | 20 | | for our application. We just need to utilize it! We'll require it |
21 | 21 | | into the script here so that we do not have to worry about the |
22 | | -| loading of any our classes 'manually'. Feels great to relax. |
| 22 | +| loading of any our classes "manually". Feels great to relax. |
23 | 23 | | |
24 | 24 | */ |
25 | 25 | require dirname(__DIR__) . '/vendor/autoload.php'; |
|
38 | 38 | trigger_error($th); |
39 | 39 | } |
40 | 40 |
|
41 | | -/* |
42 | | -|-------------------------------------------------------------------------- |
43 | | -| Attach blade view |
44 | | -|-------------------------------------------------------------------------- |
45 | | -| |
46 | | -| Since blade no longer ships with Leaf by default, we |
47 | | -| can attach blade back to Leaf so you can use Leaf MVC |
48 | | -| as you've always used it. |
49 | | -| |
50 | | -*/ |
51 | | -Leaf\View::attach(\Leaf\Blade::class); |
52 | | - |
53 | 41 | /* |
54 | 42 | |-------------------------------------------------------------------------- |
55 | 43 | | Load application paths |
|
70 | 58 |
|
71 | 59 | /* |
72 | 60 | |-------------------------------------------------------------------------- |
73 | | -| Load application paths |
| 61 | +| Attach blade view |
74 | 62 | |-------------------------------------------------------------------------- |
75 | 63 | | |
76 | | -| Tell Leaf MVC Core where to locate application paths |
| 64 | +| Since blade no longer ships with Leaf by default, we |
| 65 | +| can attach blade back to Leaf so you can use Leaf MVC |
| 66 | +| as you've always used it. |
77 | 67 | | |
78 | 68 | */ |
79 | | -Leaf\Core::paths(PathsConfig()); |
| 69 | +Leaf\View::attach(\Leaf\Blade::class); |
80 | 70 |
|
81 | 71 | /* |
82 | 72 | |-------------------------------------------------------------------------- |
83 | | -| Additional Leaf Database Config |
| 73 | +| Load Leaf configuration |
84 | 74 | |-------------------------------------------------------------------------- |
85 | 75 | | |
86 | | -| Load leaf database configuration |
| 76 | +| Leaf MVC allows you to customize Leaf and it's modules using |
| 77 | +| configuration files defined in the config folder. This line |
| 78 | +| loads the configuration files and makes them available to |
| 79 | +| your application. |
87 | 80 | | |
88 | 81 | */ |
89 | | -Leaf\Database::config(DatabaseConfig()); |
| 82 | +Leaf\Core::loadApplicationConfig(); |
90 | 83 |
|
91 | 84 | /* |
92 | 85 | |-------------------------------------------------------------------------- |
|
97 | 90 | | This allows you to use Leaf Db without having to initialize it |
98 | 91 | | in your controllers. |
99 | 92 | | |
100 | | -| This is optional, you can still use Leaf Db in your controllers. If you |
101 | | -| want to opt into this, just uncomment the line below. |
| 93 | +| This is optional, you can still use your own Leaf Db connections in |
| 94 | +| your controllers. If you want to opt into this, |
| 95 | +| just uncomment the line below. |
102 | 96 | | |
103 | 97 | */ |
104 | 98 | // Leaf\Database::syncLeafDb(); |
105 | 99 |
|
106 | | -/* |
107 | | -|-------------------------------------------------------------------------- |
108 | | -| Initialise Config |
109 | | -|-------------------------------------------------------------------------- |
110 | | -| |
111 | | -| Pass your application configuration into your leaf app. |
112 | | -| |
113 | | -*/ |
114 | | -app()->config(AppConfig()); |
115 | | - |
116 | | -/* |
117 | | -|-------------------------------------------------------------------------- |
118 | | -| Default fix for CORS |
119 | | -|-------------------------------------------------------------------------- |
120 | | -| |
121 | | -| This just prevents the connection client from throwing |
122 | | -| CORS errors at you. |
123 | | -| |
124 | | -*/ |
125 | | -app()->cors(CorsConfig()); |
126 | | - |
127 | 100 | /* |
128 | 101 | |-------------------------------------------------------------------------- |
129 | 102 | | Route Config |
|
0 commit comments