Download the PHP package raditzfarhan/yii2-sanitizer without Composer

On this page you can find all versions of the php package raditzfarhan/yii2-sanitizer. 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 yii2-sanitizer

Yii2 Sanitizer

Yii2 Sanitizer is an easy way to sanitize or filter your inputs for application that uses Yii2 framework.

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Release Changes

NOTE: Refer the CHANGE LOG for details on changes to various releases.

Usage

Add this to the component section of your main config.

Examples

Filters an array on inputs

Results in:

Usage is fairly simple. Your filter array needs to match the data array with the filters as the array value. You can combine the filters and it will be executed in order from left to right.

Filter single value

Results in:

The first argument would be the value that needs filtering. The second argument would be the filters that needs to be applied.

Available Filters

Here are the filters that you can use:

Filter Description
cast Cast given value into given type. Options are int, float, string.
digit Will removes non-digit from given value.
encode Escaping unwanted tags and only output plain HTML using Yii2 HTML:encode() function.
escape Quote string with slashes using filter_var (FILTER_SANITIZE_MAGIC_QUOTES) function.
float Removes unwanted characters and remain a float number only. Similar to cast:float.
int Removes unwanted characters and remain a integer number only. Similar to case:int.
purify Purify HTML content using Yii2 HtmlPurifier::process() function. Note that HtmlPurifier processing is quite heavy so use with caution.
strip_tags Removes HTML tags from given string value.
trim Trims a string and remove white spaces.

License

Yii2 Sanitizer is released under the MIT license


All versions of yii2-sanitizer with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version ~2.0.0
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 raditzfarhan/yii2-sanitizer contains the following files

Loading the files please wait ....