# Как создать плагин с вызовами бэкенд API для заполнения Composer во время черновика?

**URL:** https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970
**Category:** Development
**Created:** [12.Март.2025 14:38:02 UTC](https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970 "2025-03-12T14:38:02Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [12.Март.2025 20:03:13 UTC](https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970/5 "2025-03-12T20:03:13Z")

</div>

> [@fabkosta](#):
>
> Вопрос: Где я могу найти документацию для DModal, DButton и других подобных объектов, специфичных для Discourse?

Вот здесь:

> [@Using the DModal API to render Modal windows (aka popups/dialogs) in Discourse](https://meta.discourse.org/t/using-the-dmodal-api-to-render-modal-windows-aka-popups-dialogs-in-discourse/268304):
>
> Discourse 3.1.0.beta6 ships with a brand new \<DModal\> component-based API. information_source This supersedes the old controller-based API, which is now deprecated. If you have existing modals using the old APIs, check out the migration guide [here](https://meta.discourse.org/t/converting-modals-from-legacy-controllers-to-new-dmodal-component-api/268057). Rendering a Modal Modals are rendered by including the \<DModal\> component in a handlebars template. If you don’t already have a suitable template, check out [Using Plugin Outlet Connectors from a Theme or Plugin](https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727). A simple modal would look someth…

Также стоит обратить внимание:

> [@Discourse toolkit to render forms](https://meta.discourse.org/t/discourse-toolkit-to-render-forms/326439?silent=true):
>
> Basic Usage FormKit exposes a single component as its public API: \<Form /\>. All other elements are yielded as contextual components, modifiers, or plain data. Every form is composed of one or multiple fields, representing the value, validation, and metadata of a control. Each field encapsulates a control, which is the form element the user interacts with to enter data, such as an input or select. The control type is specified via @type on the field. Other utilities, like submit or alert, are …

Вы можете посмотреть примеры в Discourse/plugins/theme components.

---

_[View the full topic](https://meta.discourse.org/t/how-to-create-a-plugin-with-backend-api-calls-to-populate-composer-while-drafting/356970)._
