Skip to content

Commit

Permalink
Update screens.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tabuna authored Sep 16, 2024
1 parent 4ee5069 commit 8f7c564
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions docs/ru/docs/screens.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ PHP предлагает мощную возможность наследова
```php
use Orchid\Screen\Actions\Button;

Button::make("Привет, мир!"')
Button::make("Привет, мир!")
->action(route('platform.screens.users', [
'method' => 'hello',
]));
Expand Down Expand Up @@ -373,42 +373,28 @@ use Orchid\Screen\Fields\Input;
use Orchid\Screen\Fields\Label;
use Orchid\Screen\Layouts\Rows;

class ReusableEditLayout extends Rows
class ReusableLayout extends Rows
{
/**
* @var string
*/
private $title;

/**
* @var string
* Constructor with automatic property declaration and initialization.
*/
private $prefix;

/**
* ReusableEditLayout constructor.
*
* @param string $prefix
* @param string $title
*/
public function __construct(string $prefix, string $title)
{
$this->prefix = $prefix;
$this->title = $title;
}
public function __construct(
private readonly string $prefix,
private readonly string $title
) {}

/**
* Views.
* Define the fields for the layout.
*
* @return Field[]
*/
protected function fields(): array
{
return [
Label::make('label')
new Label('label')
->title($this->title),

Input::make($this->prefix . '.address')
new Input($this->prefix . '.address')
->required()
->title('Address')
->placeholder('177A Bleecker Street'),
Expand Down

0 comments on commit 8f7c564

Please sign in to comment.