Download the PHP package tweekersnut/forms-lib without Composer
On this page you can find all versions of the php package tweekersnut/forms-lib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tweekersnut/forms-lib
More information about tweekersnut/forms-lib
Files in tweekersnut/forms-lib
Package forms-lib
Short Description A comprehensive PHP forms library for Laravel and Core PHP with Bootstrap/Tailwind support, AJAX handling, and validation
License MIT
Informations about the package forms-lib
Forms Library - PHP
A comprehensive, flexible PHP forms library for Laravel and Core PHP with Bootstrap/Tailwind CSS support, AJAX handling, dynamic validation, and CSRF token protection.
Features
- ✨ Multiple Field Types - Text, Email, Password, Textarea, Select, Checkbox, Radio, File, Hidden, and more
- 🎨 CSS Framework Support - Bootstrap 5 and Tailwind CSS with easy theme switching
- ✅ Built-in Validation - Email, URL, phone, date, numeric, and custom validators
- 🔄 AJAX Support - Complete AJAX form handling with real-time validation
- 🛡️ CSRF Protection - Built-in CSRF token generation and verification
- 🚀 Laravel Integration - Service provider, facades, and helper functions
- 📦 Core PHP Compatible - Works standalone without any framework
- 🎯 Customizable - Custom attributes, classes, IDs, and validation rules
- 📱 Responsive - Mobile-friendly form rendering
- 🏷️ Shortcode System - Create reusable forms for forums, CMS, and content platforms with callbacks
Installation
Laravel Setup
Add to your config/app.php providers:
Publish configuration:
Quick Start
Core PHP
Laravel
Or use the helper:
Field Types
TextField- Text input with optional type (text, email, password, number, etc.)EmailField- Email input with validationPasswordField- Password inputNumberField- Number inputPhoneField- Phone number inputURLField- URL inputDateField- Date inputTimeField- Time inputDateTimeField- DateTime inputTextAreaField- Textarea with configurable rows/colsSelectField- Dropdown selectCheckboxField- Checkbox groupRadioField- Radio button groupFileField- File uploadHiddenField- Hidden inputSubmitField- Submit buttonResetField- Reset buttonButtonField- Generic button
Validation Rules
Built-in validators:
required- Field is requiredemail- Valid email formatnumeric- Numeric valuephone- Valid phone numberurl- Valid URLdate- Valid datedatetime- Valid datetimemin:n- Minimum lengthmax:n- Maximum lengthminvalue:n- Minimum numeric valuemaxvalue:n- Maximum numeric valuematch:value- Match specific value
Custom Validation
AJAX Handling
PHP Backend
JavaScript Frontend
CSRF Token Protection
Protect your forms from Cross-Site Request Forgery attacks:
CSRF Token Methods
Themes
Bootstrap 5
Tailwind CSS
Examples
See the examples/ directory for complete working examples:
01-basic-form.php- Basic form creation02-form-with-validation.php- Form validation03-ajax-form.php- AJAX form submission04-csrf-token-form.php- CSRF token protection
API Reference
FormBuilder
Field
Shortcodes (Forums & CMS)
Create reusable forms that can be embedded in forum posts and CMS content using simple shortcode syntax:
Use in content:
See SHORTCODES_GUIDE.md for complete documentation and examples.
Documentation
- QUICKSTART.md - 5-minute quick start guide
- INTEGRATION_GUIDE.md - Detailed integration instructions for Core PHP and Laravel
- API_REFERENCE.md - Complete API reference
- SHORTCODES_GUIDE.md - Shortcode system documentation
- examples/ - Working examples for all features
License
MIT License - see LICENSE file for details
Support
For issues, questions, or contributions, please visit the repository.