This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

octobercms34181
octobercms34181

I am designing a plugin for a car rental agency and the car prices can vary by date. I want to provide 2 ways to set the rates: either in bulk by entering a date range, or by viewing some sort of calendar and modifying the prices for individual dates. In my model's columns.yaml file I have the following:

columns:
    buttons:
        label: Actions
        type: partial
        path: ~/plugins/carrental/newcars/models/inventory/_list_buttons.htm
        clickable: false

And I have created the respective _list_buttons.htm file with a couple of buttons:

<a href="<?= Backend::url('carrental/newcars/inventory/update-bulk', $record->id) ?>" class="btn btn-default btn-xs">
    Edit by date range
</a>
<a href="<?= Backend::url('carrental/newcars/inventory/update-dates', $record->id) ?>" class="btn btn-default btn-xs">
    Edit individual dates
</a>

Then in my controller I add methods for the above URLs. For example:

public function updateBulk()
{
    return "hello world";
}

This just displays "hello world" to the page. Now the question is, how do I register something like a fields.yaml file with this custom action so that I can render the forms?

Last updated

1-1 of 1

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.