Some questions about Tailor

Hi there! I have some questions about work with Tailor.

  1. /app/Provider.php what this? How can i use this class? Maybe for my custom code? For what this class?

  2. Where i can store my custom code for extend Tailor and more? Only in my plugins code base? Whats the right way to extend Tailor?

  3. I want extend backend form fields (created with Tailor), and add some ajax code. For example, click to button, and sends request to onDoSomething(). Where i can place this method?

<button
    type="button"
    data-request="onDoSomething"
    class="btn btn-default">
    Do Something
</button>

Where i can store method onDoSomething for my backend Tailor form?

Hi @anik1ng

  1. The app/ directory is similar to a plugin, and the Provider.php file is the same as a Plugin.php registration file. They both can do the same things.

  2. You can place custom code in a plugin or the app directory.

  3. Create a form widget for this and register it as a content field. This will give you complete AJAX support within the form.

Here is the documentation on creating a form widget:

Here is the documentation on registering a form widget as a content field:

I hope this helps.