Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| LinkComponent | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| render | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Hyde\Framework\Views\Components; |
| 6 | |
| 7 | use Hyde\Hyde; |
| 8 | use Illuminate\Support\Facades\View; |
| 9 | use Illuminate\Contracts\View\View as ViewContract; |
| 10 | use Illuminate\View\Component; |
| 11 | |
| 12 | class LinkComponent extends Component |
| 13 | { |
| 14 | public readonly string $href; |
| 15 | |
| 16 | public function __construct(string $href) |
| 17 | { |
| 18 | $this->href = Hyde::relativeLink($href); |
| 19 | } |
| 20 | |
| 21 | /** @interitDoc */ |
| 22 | public function render(): ViewContract |
| 23 | { |
| 24 | return View::make('hyde::components.link'); |
| 25 | } |
| 26 | } |