mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 06:26:16 +00:00
2.x - backups
This commit is contained in:
26
app/Web/Components/Link.php
Normal file
26
app/Web/Components/Link.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Web\Components;
|
||||
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\View\Component;
|
||||
|
||||
class Link extends Component implements Htmlable
|
||||
{
|
||||
public function __construct(public string $href, public string $text, public bool $external = false) {}
|
||||
|
||||
public function render(): View
|
||||
{
|
||||
return view('web.components.link');
|
||||
}
|
||||
|
||||
public function toHtml(): View|string
|
||||
{
|
||||
return $this->render()->with([
|
||||
'href' => $this->href,
|
||||
'text' => $this->text,
|
||||
'external' => $this->external,
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user