# Кнопки управления ресурсом

За вывод кнопок управления ресурсами в Rock.Cms отвечает отдельный компонент **resource-buttons**.

Компонент принимает массив с действиями и автоматически выводит нужные кнопки.

```php
@section('buttons')
    <livewire:resource-buttons :buttons="[
        'create,
        'lasave',
        'saveAndExit',
        'cancel',
        'delete'
    ]"/>
@stop
```

* **create** - создание ресурса
* **save** - сохранение ресурса
* **saveAndExit** - сохранение и возврат к списку ресурсов
* **cancel** - возврат назад
* **delete** - удаление ресурса

Для правильной работы в классе ресурса нужно указать именованные роуты для каждого действия.

```php
class PostItem extends ResourceComponent
{
    public string $nameRouteResourceList = 'posts.list'; // для перехода к списку ресурсов
    public string $nameRouteResourceEdit = 'posts.edit'; // для редактирования ресурса
    public string $nameRouteResourceCreate = 'posts.create'; // для создания ресурса
    
    ...
}
```

\ <br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://web-vovan.gitbook.io/rock-cms/nastroika/knopki-upravleniya-resursom.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
