File tree Expand file tree Collapse file tree 3 files changed +24
-7
lines changed
Expand file tree Collapse file tree 3 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**@var Leaf\App $app */
3+
4+ $ app ->get ("/ " , function () {
5+ echo view ("index " );
6+ });
Original file line number Diff line number Diff line change 22
33/**@var Leaf\App $app */
44
5+ // You can break up routes into individual files
6+ require __DIR__ . "/_app.php " ;
7+
58/*
69|--------------------------------------------------------------------------
710| Set up 404 handler
1013| Create a handler for 404 errors
1114|
1215*/
13-
1416$ app ->set404 (function () {
15- response ()-> headers -> status (404 );
17+ Leaf \ Http \Headers:: status (404 );
1618 response ()->page (views_path ("errors/404.html " , false ));
1719});
1820
21+ /*
22+ |--------------------------------------------------------------------------
23+ | Set up 500 handler
24+ |--------------------------------------------------------------------------
25+ |
26+ | Create a handler for error 500
27+ |
28+ */
29+ $ app ->setErrorHandler (function () {
30+ Leaf \Http \Headers::status (500 );
31+ response ()->page (views_path ("errors/500.html " , false ));
32+ });
33+
1934/*
2035|--------------------------------------------------------------------------
2136| Set up Controller namespace
2641|
2742*/
2843$ app ->setNamespace ("\App\Controllers " );
29-
30- $ app ->get ("/ " , function () {
31- echo view ("index " );
32- });
Original file line number Diff line number Diff line change 1515 <h1 >{{ getenv (' APP_NAME' ) ?? " Leaf MVC" } } </h1 >
1616 <p >
1717 This is the LeafMVC framework. A simple MVC framework built for
18- <a href =" https://leafphp.netlify.app" class =" wynter text-green" >Leaf PHP Framework</a >
18+ <a href =" https://leafphp.netlify.app" class =" text-green" >Leaf PHP Framework</a >
1919 </p >
2020 </section >
2121 <section >
You can’t perform that action at this time.
0 commit comments