Improves the built-in form block so it submits via ajax. Also uses a table-less layout for easier styling.
This repository is a fork of https://github.com/jordanlev/c5_ajax_form
- Download repository as .zip
- Add the
form
directory in your package/packages/nameofyourpackage/blocks
. - If you want to use this block within your package add the following code in the on_start method of your package controller:
$environment = \Environment::get();
$environment->overrideCoreByPackage('blocks/form/controller.php', $this);
Route::register('/tools/blocks/form/responder', function() {
include('packages/nameofyourpackage/blocks/form/tools/responder.php');
});
- Replace the package name in the controller namespace of:
/packages/nameofyourpackage/blocks/form/controller.php
and replace nameofyourpackage with the name of your package in/packages/nameofyourpackage/blocks/form/tools/responder.php
.
- Optionally move
view.php
fromblocks/form/view.php
toblocks/form/templates/nameofyourtemplate/view.php
to prevent from overriding the default template.
Although I haven't tried nor documented, this block should be easy to implement without a package, directly in your /application
directory.