File tree Expand file tree Collapse file tree 6 files changed +94
-43
lines changed
Expand file tree Collapse file tree 6 files changed +94
-43
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class Layouts extends BaseConfig
1111 *
1212 * @var string
1313 */
14- public $ default = '' ;
14+ public $ default = 'Tatter\Layouts\Views\Layouts\Default ' ;
1515
1616 /**
1717 * Provides a fallback to the default layout
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ <!doctype html>
2+ <html lang="en">
3+ <head>
4+ <meta charset="utf-8">
5+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+ <meta name="description" content="<?= $ headerDescription ?? 'Layouts ' ?> ">
7+ <meta name="author" content="<?= $ headerAuthor ?? 'Tatter Software ' ?> ">
8+ <meta name="theme-color" content="#7952b3">
9+ <title><?= $ headerTitle ?? 'Website ' ?> </title>
10+
11+ <!-- Bootstrap core CSS -->
12+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
13+
14+ <?= $ this ->renderSection ('headerAssets ' ) ?>
15+
16+ </head>
17+ <body>
18+ <nav class="navbar navbar-expand-md navbar-dark bg-dark">
19+ <a class="navbar-brand" href="<?= site_url () ?> ">Home</a>
20+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbars" aria-controls="navbars" aria-expanded="false" aria-label="Toggle navigation">
21+ <span class="navbar-toggler-icon"></span>
22+ </button>
23+
24+ <div class="collapse navbar-collapse" id="navbars">
25+
26+ <?= $ this ->renderSection ('navbar ' ) ?>
27+
28+ </div>
29+ </nav>
30+ <main role="main" class="container my-5">
31+
32+ <?= $ this ->renderSection ('main ' ) ?>
33+
34+ </main><!-- /.container -->
35+
36+ <!-- Bootstrap bundle JS -->
37+ <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
38+
39+ <?= $ this ->renderSection ('footerAssets ' ) ?>
40+
41+ </body>
42+ </html>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Tests \Support \TestCase ;
4+
5+ /**
6+ * @internal
7+ */
8+ final class ConfigTest extends TestCase
9+ {
10+ public function testUsesDefaultAsFallback ()
11+ {
12+ $ result = config ('Layouts ' )->banana ;
13+
14+ $ this ->assertSame ('Tatter\Layouts\Views\Layouts\Default ' , $ result );
15+ }
16+
17+ public function testSupportsRegistrars ()
18+ {
19+ $ result = config ('Layouts ' )->foo ;
20+
21+ $ this ->assertSame ('bar ' , $ result );
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Support \Config ;
4+
5+ class Registrar
6+ {
7+ /**
8+ * Adds a layout to the config to verify it
9+ * supports using Registrars.
10+ *
11+ * @return array<string,string>
12+ */
13+ public static function Layouts (): array
14+ {
15+ return [
16+ 'foo ' => 'bar ' ,
17+ ];
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tests \Support ;
4+
5+ use CodeIgniter \Test \CIUnitTestCase ;
6+
7+ abstract class TestCase extends CIUnitTestCase
8+ {
9+ }
You can’t perform that action at this time.
0 commit comments