mirror of https://github.com/flightphp/core
parent
50c23de325
commit
bc86e7a298
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace tests\views\components;
|
||||
|
||||
use flight\template\Component;
|
||||
use Override;
|
||||
|
||||
if (!class_exists('AnotherClassComponent')) {
|
||||
class AnotherClassComponent extends Component
|
||||
{
|
||||
#[Override]
|
||||
public function html(): string
|
||||
{
|
||||
return 'another-class-component';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use tests\views\components\AnotherClassComponent;
|
||||
|
||||
require_once __DIR__ . '/another-class-component.php';
|
||||
|
||||
return new class extends AnotherClassComponent
|
||||
{
|
||||
#[Override]
|
||||
public function html(): string
|
||||
{
|
||||
return parent::html() . ' extended by my-class-component-that-extends-another-class-component';
|
||||
}
|
||||
};
|
||||
@ -0,0 +1 @@
|
||||
<f-my-class-component-that-extends-another-class-component />
|
||||
Loading…
Reference in new issue