Closed Nav33d closed 6 years ago
Can you give a concrete example of what you're thinking? Perhaps some HTML of expected output from Former?
I don't have anything specific in my mind but something like a DateTime field which displays a calendar to select date or field to attache other model entries?
Appreciate your quick response!
Many thanks
Hi @Nav33d; there are several ways to support custom elements in Former, depending on the exact element in question. Most things like DateTime fields are added using JavaScript libraries, and Former makes it easy to use such libraries via customization of the HTML it outputs:
<?php
echo Former::text('foo')->raw(); // Print an input without surrounding div's
echo Former::text('foo')->addClass('bar'); // Add a custom class to an element (for JS libraries)
echo Former::text('foo')->onGroupAddClass('bar'); // Add a custom class to the container element
Hi,
I was wondering if it is possible to add a custom fields?
Many thanks