Winter CMS resources and help articles

Simple and to the point. Optimized by the community.

Add actions to Relation Manage Form

0
by mjauvin, last modified on August 31st, 2023

If you want to modify the Relation behavior default Manage Form, just copy the original partial (from modules/backend/behaviors/relationcontroller/partials/_manage_form.php) to your controller's partial folder, prefixing "_relation" to the original partial name.

Modify to your liking. An example to add a "delete" action is shown below:

<button
    type="button"
    class="oc-icon-trash-o btn-icon danger m-l-lg"
    data-request="onRelationButtonDelete"
    data-request-data="checked:[<?= $relationManageId ?>]"
    data-request-confirm="<?= e(trans('backend::lang.relation.delete_confirm')) ?>"
    data-request-success="$(this).trigger('close.oc.popup')">
</button>

Starting with Winter v2.1.4, you will be able to override only the following partials:

  • _manage_form_footer_create.php
  • _manage_form_footer_update.php
  • _manage_pivot_footer.php
  • _pivot_form_footer.php

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?