Download the PHP package davebugg/validony without Composer

On this page you can find all versions of the php package davebugg/validony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package validony

Validony

Powerful and Flexible PHP Data Validator

PHP Version

Validony is a modern PHP library for data validation that provides flexible capabilities for validating data arrays with customizable rules, error messages, and callback functions.

🚀 Features

⚠️ IMPORTANT: The default Checker, Messages, and Lists classes included with this library are examples only. For production applications, you should create your own custom classes with validation rules, error messages, and field names specific to your application's needs.

📦 Installation

🔧 Quick Start

Basic Usage

🏗️ Custom Classes - RECOMMENDED APPROACH

⚠️ Important: For production applications, it's highly recommended to create your own custom classes instead of using the default ones. This gives you full control over validation logic, error messages, and field names.

1. Custom Checker Class

Create your own validation methods class based on the default Checker class:

2. Custom Messages Class

Create your own messages class for multilingual error messages:

3. Custom Lists Classes

Create organized validation rule sets for different forms:

4. Using Custom Classes

Now use your custom classes with Validony:

5. Complete Example with Custom Classes

🛠 Constructor and Settings

Constructor Parameters

Detailed Parameter Description

Parameter Type Default Description
$post array - Required. Data array to validate (usually $_POST)
$customMessagesMass array\|bool false Custom error messages array
$customFieldName array\|bool false Array for renaming fields in messages
$checkerClass mixed Checker::class Class containing validation methods
$callback array [] Array [class, method] for callback function
$errLanguage string 'en' Language for error messages
$printField bool true Include field name in error message
$printData bool false Include field value in error message
$getAllErrors bool false Collect all errors (true) or stop on first (false)
$doCallback bool false Automatically call callback when error is found

📋 Validation Methods

1. CheckData() - Main Validation

Validates data according to specified rules.

Example:

2. ValidateList() - Validation via Rule Lists

Uses predefined rule lists from classes in the Lists folder.

⚠️ Important: The ValidateList method will use the Checker class specified in the constructor. If you pass a custom $checkerClass to the constructor, your Lists classes should reference that custom checker, not the default Checker class.

Example with Default Checker:

Example with Custom Checker (RECOMMENDED):

How it works:

  1. Validony looks for the specified method (registrationRules) in classes within the Lists folder
  2. The method returns an array of validation rules
  3. Each rule references methods from the Checker class specified in the constructor
  4. If you use MyChecker::class in constructor, your Lists should use MyChecker::methodName
  5. If you use default Checker::class (or false), your Lists should use Checker::methodName

3. CheckLikeFieldsData() - Similar Fields Validation

Example:

📤 Getting Results

isValid() - Check Validity

getErrors() - Get Errors

Parameters:

Examples:

🎯 Static Methods

For quick usage without creating class instance.

Validon::CheckData()

Validon::ValidateList()

🔧 Configuration Examples

Minimal Setup (NOT RECOMMENDED for production)

Recommended Production Setup

Development Setup with Debugging

Multi-Environment Configuration

🔧 Advanced Examples

Example 1: Complete Registration System

Example 2: Multiple Fields Validation

🌐 Multi-language Support

Using Your Custom Messages Class (RECOMMENDED)

The best approach is to create your own Messages class with all the languages and messages you need:

Dynamic Language Switching

🔍 Debugging and Logging

Enable Detailed Messages

Custom Error Handler

📚 API Reference

Main Methods

Method Description Returns
__construct() Create validator instance void
CheckData() Validate by rules bool
ValidateList() Validate via rule lists void
CheckLikeFieldsData() Validate similar fields bool
isValid() Check validation result bool
getErrors() Get errors array

Static Methods

Method Description Returns
Validon::CheckData() Static validation array
Validon::ValidateList() Static validation via lists array
Validon::CheckLikeFieldsData() Static validation of similar fields array

🤝 Contributing

We welcome contributions to the project! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

Need help? We're here for you:

🔗 Links


Validony - Making data validation simple and powerful! 🚀


All versions of validony with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.0
ext-json Version *
ext-fileinfo Version *
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package davebugg/validony contains the following files

Loading the files please wait ....