Skip to content

Commit

Permalink
Connect htmlParser to a default blade adapter
Browse files Browse the repository at this point in the history
Add settings to the rr.yaml enabling it server static assets
  • Loading branch information
nmeri17 committed Jul 3, 2023
2 parents 42b5fbb + 87e78f2 commit 7c09e54
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

# hidden for installs to always request fresh copies of the dependencies instead of binding to versions cached in composer.lock and requiring an update before fetching
composer.lock
rr-queues.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace AllModules\_module_name\Config;

use Suphle\Adapters\Presentation\Blade\DefaultBladeAdapter;

use AllModules\_module_name\Markup\Components\AppLayouts;

class CustomBladeAdapter extends DefaultBladeAdapter
{
public function bindComponentTags(): void
{

$this->bladeCompiler->component("layout", AppLayouts::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@

class AppLayouts extends Component
{
public function __construct($pageTitle, $scripts)
public function __construct(

public string $pageTitle = "Suphle", public string $scripts = ""
)
{

//
}

/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
*/
public function render()
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ $pageTitle ?? "Suphle"}}</title>
<title>{{$pageTitle}}</title>

@yield("scripts")
{{$scripts}}
</head>
<body>
{{ $slot }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<x-layout page_title="Random Page">
<main></main>
</x-layout>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Suphle\Hydration\Structures\BaseInterfaceCollection;

use Suphle\Contracts\{Config\Router, Auth\UserContract};
use Suphle\Contracts\{Config\Router, Auth\UserContract, Presentation\HtmlParser};

use AllModules\_module_name\Config\RouterMock;
use AllModules\_module_name\Config\{RouterMock, CustomBladeAdapter};

use AppModels\User as EloquentUser; // hard-coded cuz different processes control module cloning and component ejection

Expand All @@ -30,7 +30,9 @@ public function simpleBinds(): array

_module_name::class => ModuleApi::class,

UserContract::class => EloquentUser::class
UserContract::class => EloquentUser::class,

HtmlParser::class => CustomBladeAdapter::class
]);
}
}
6 changes: 6 additions & 0 deletions dev-rr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ http:
address: localhost:8080
pool:
num_workers: 4
middleware: ["headers", "static", "gzip"]
uploads:
forbid: [".php", ".exe", ".bat"]
static:
dir: "public"
forbid: [".php", ".htaccess"]

# Boltdb jobs driver
#
Expand Down

0 comments on commit 7c09e54

Please sign in to comment.