Loading repository data…
Loading repository data…
AntonyThorpe / repository
Provides an enhanced UX using the Knockout MVVM JavaScript library, plus an associated validation plugin, with Silverstripe forms. Silverstripe generates a form, specifying the Knockout styled form fields, and validation needs are added to observables via a Knockout js extension. Default messages are available or can be customised. The submit button will only be enabled upon satisfaction of all the validation rules.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Provides an enhanced UX for Silverstripe forms using the Knockout MVVM JavaScript library plus an associated validation plugin
Add validation needs to the observables in a Knockoutjs viewModel. Next, utilising the Knockout Form Fields, use Silverstripe to create the form. Upon bind, the field values are passed into the observables via a custom binding handler. The rules placed upon the observable will control the field validation.
The recommended approach is to extend an existing Silverstripe field. Ensure that the appropriate Binding Type is specified and cast getters from trait class Common.php and add any needed methods.
namespace AntonyThorpe\Knockout;
require_once('Common.php');
use SilverStripe\Forms\????ParentField;
/**
* Knockout NameOfNewField
*
* Creates a {@link NameOfNewField} with an additional data-bind attribute that links to a Knockout observable
*/
class KnockoutNameOfField extends ????ParentField
{
use \Knockout\Common;
/**
* bindingType
*/
protected $bindingType = "theKnockoutBindingHandler";
If needed add the __construct function to overriding the field's class.
Adapt the Frameworks form templates to incorporate Knockout's binding handlers and save into templates/AntonyThorpe/Knockout.
KnockoutFormTest.php and KnockoutFormTestController.php to test the creation of the binding handler in HTML.docs/en/documentation.mdNone sorry.