Download the PHP package wenprise/forms without Composer
On this page you can find all versions of the php package wenprise/forms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package forms
wenprise-forms
Extend Nette Forms for WordPress use.
Basic usage: Nette Form
Features
- Supports both Composer library mode and WordPress plugin mode
- Extends Nette Forms with WordPress-ready fields and UI widgets
- Includes form validation, conditional display, datastore integration, and AJAX-friendly inputs
Requirements
- PHP
>=8.3 ext-jsonnette/forms ^3.2nette/utils ^4.1- WordPress
>=6.0(recommended)
Installation
Option A: Install as a Composer library
Option B: Install as a WordPress plugin
- Clone or download this repository into
wp-content/plugins/wenprise-forms. - Run
composer installinside the plugin directory. - Activate
Wenprise Formsin WordPress admin.
Runtime Modes
Composer library mode
- Your project is responsible for loading Composer autoload.
- Your code decides when and where to bootstrap the form objects.
WordPress plugin mode
- Plugin entry file
wenprise-forms.phploadsvendor/autoload.phpautomatically. - Plugin bootstraps with
new \Wenprise\Forms\Init();.
Quick Start (Minimal Working Example)
Forms has its own HTTP request handling flow. Instantiate it before head_sent, usually on init.
Usage
Quick start
Forms includes its own HTTP request handling flow, so instantiate it before head_sent, usually in the init action.
Create a Form instance
``
Frontend Assets
Some fields depend on JavaScript/CSS widgets (for example: Slider, Chosen, Date Picker, Signature, Star Rating, Autocomplete, Chained Select).
- Ensure assets are properly enqueued in your theme/plugin runtime.
- Prefer testing one advanced field at a time when integrating into existing themes.
Security Notes
- Always include CSRF protection for public forms (
$form->addCsrf(...)). - For AJAX endpoints, validate nonce and capability before processing input.
- Sanitize incoming data and escape output in templates.
- Do not trust client-side validation alone; keep validation rules on the server side.
Set Required
Add rule
Add field description
With Html
Set condition display
Control width
setWidth() supports both Bootstrap-based renderers and TailwindGridFormRender.
You can also define responsive widths with breakpoint names:
Or use the shorthand form:
The shorthand above means:
base = 6md = 3lg = 4
With DefaultFormRender('vertical') and InlineFormRender(), setWidth() is mapped to Bootstrap-style classes such as rs-col-md-4.
With TailwindGridFormRender('vertical'), setWidth() is mapped to grid span classes such as rs-grid-form__span-md-4.
DefaultFormRender('horizontal') keeps each field full width by design, so width settings are ignored there.
Repeater
Use addRepeater() to build repeatable field groups.
addRepeater() arguments:
$name: repeater field name$label: repeater label$factory: callback used to define each row container$copy_count: initial row count$max_copies: optional maximum row count
Submitted values are returned as nested arrays and can be stored by the built-in datastore layer.
Multiple Submit Button
Use html in label or description
Set Datastore
Custom Settings Page Example
Use OptionsDatastore to build a WordPress admin settings page quickly.
Tab Groups
Use tab groups to split long forms into multiple panels.
Tabs are rendered automatically through the existing render flow ($form->render() / echo $form), so no extra render method is required.
Submit buttons created inside tab groups are rendered outside tab panes automatically, so the save action stays visible.
You can also use underscore naming method:
Stepper Groups
Use stepper groups to render a progress bar with previous and next step actions.
You can also use underscore naming method:
If you render inside a shortcode callback, return the form HTML instead of echoing:
Fields
nonce field
``
WordPress Tinymce editor
``
Ajax uploader
Uploader backend sample.
``
Slider input
``
Data Picker
``
Color Picker
``
Chosen
``
Multi Chosen
``
Signature Field
``
Star rating input
``
Image Select
``
Autocomplete Input
Source is an array or a url returns an array.
If Source is an ajax url, the backend need return data as bellow.
Table input
``
Group Input
Set a prefix or suffix for text input.
``
SMS input
Send SMS code
Backend Example
Captcha Input
``
Chained Select
``
Captcha backend sample.
``
``