Skip to content

Phalcon filter

NOTE

All classes are prefixed with Phalcon

Filter\Filter

Source on GitHub

  • Namespace

    • Closure
    • Phalcon\Filter\Exception
    • Phalcon\Filter\FilterInterface
  • Uses

  • Extends

  • Implements

    • FilterInterface

Lazy loads, stores and exposes sanitizer objects

Constants

const FILTER_ABSINT = absint;
const FILTER_ALNUM = alnum;
const FILTER_ALPHA = alpha;
const FILTER_BOOL = bool;
const FILTER_EMAIL = email;
const FILTER_FLOAT = float;
const FILTER_INT = int;
const FILTER_LOWER = lower;
const FILTER_LOWERFIRST = lowerFirst;
const FILTER_REGEX = regex;
const FILTER_REMOVE = remove;
const FILTER_REPLACE = replace;
const FILTER_SPECIAL = special;
const FILTER_SPECIALFULL = specialFull;
const FILTER_STRING = string;
const FILTER_STRIPTAGS = striptags;
const FILTER_TRIM = trim;
const FILTER_UPPER = upper;
const FILTER_UPPERFIRST = upperFirst;
const FILTER_UPPERWORDS = upperWords;
const FILTER_URL = url;

Properties

/**
 * @var array
 */
protected $mapper;

/**
 * @var array
 */
protected $services;

Methods

public function __construct( array $mapper = [] );
Key value pairs with name as the key and a callable as the value for the service object

public function get( string $name ): mixed;
Get a service. If it is not in the mapper array, create a new object, set it and then return it.

public function has( string $name ): bool;
Checks if a service exists in the map array

public function sanitize( mixed $value, mixed $sanitizers, bool $noRecursive = bool ): mixed;
Sanitizes a value with a specified single or set of sanitizers

public function set( string $name, callable $service ): void;
Set a new service to the mapper array

protected function init( array $mapper ): void;
Loads the objects in the internal mapper array

Filter\Exception

Source on GitHub

  • Namespace

    • Phalcon\Filter
  • Uses

  • Extends

    Phalcon\Exception

  • Implements

Phalcon\Filter\Exception

Exceptions thrown in Phalcon\Filter will use this class

Filter\FilterFactory

Source on GitHub

  • Namespace

    • Phalcon\Filter
  • Uses

    • Phalcon\Filter
  • Extends

  • Implements

Class FilterFactory

Methods

public function newInstance(): FilterInterface;
Returns a Locator object with all the helpers defined in anonymous functions

protected function getAdapters(): array;

Filter\FilterInterface Interface

Source on GitHub

  • Namespace

    • Phalcon\Filter
  • Uses

  • Extends

  • Implements

Lazy loads, stores and exposes sanitizer objects

Methods

public function sanitize( mixed $value, mixed $sanitizers, bool $noRecursive = bool ): mixed;
Sanitizes a value with a specified single or set of sanitizers

Filter\Sanitize\AbsInt

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\AbsInt

Sanitizes a value to absolute integer

Methods

public function __invoke( mixed $input );

Filter\Sanitize\Alnum

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Alnum

Sanitizes a value to an alphanumeric value

Methods

public function __invoke( mixed $input );

Filter\Sanitize\Alpha

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Alpha

Sanitizes a value to an alpha value

Methods

public function __invoke( mixed $input );

Filter\Sanitize\BoolVal

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\BoolVal

Sanitizes a value to boolean

Methods

public function __invoke( mixed $input );

Filter\Sanitize\Email

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Email

Sanitizes an email string

Methods

public function __invoke( mixed $input );

Filter\Sanitize\FloatVal

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\FloatVal

Sanitizes a value to float

Methods

public function __invoke( mixed $input );

Filter\Sanitize\IntVal

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\IntVal

Sanitizes a value to integer

Methods

public function __invoke( mixed $input );

Filter\Sanitize\Lower

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Lower

Sanitizes a value to lowercase

Methods

public function __invoke( string $input );

Filter\Sanitize\LowerFirst

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\LowerFirst

Sanitizes a value to lcfirst

Methods

public function __invoke( string $input );

Filter\Sanitize\Regex

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Regex

Sanitizes a value performing preg_replace

Methods

public function __invoke( mixed $input, mixed $pattern, mixed $replace );

Filter\Sanitize\Remove

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Remove

Sanitizes a value removing parts of a string

Methods

public function __invoke( mixed $input, mixed $replace );

Filter\Sanitize\Replace

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Replace

Sanitizes a value replacing parts of a string

Methods

public function __invoke( mixed $input, mixed $from, mixed $to );

Filter\Sanitize\Special

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Special

Sanitizes a value special characters

Methods

public function __invoke( mixed $input );

Filter\Sanitize\SpecialFull

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\SpecialFull

Sanitizes a value special characters (htmlspecialchars() and ENT_QUOTES)

Methods

public function __invoke( mixed $input );

Filter\Sanitize\StringVal

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Sanitizes a value to string

Methods

public function __invoke( mixed $input );

Filter\Sanitize\Striptags

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Striptags

Sanitizes a value striptags

Methods

public function __invoke( string $input );

Filter\Sanitize\Trim

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Trim

Sanitizes a value removing leading and trailing spaces

Methods

public function __invoke( string $input );

Filter\Sanitize\Upper

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Upper

Sanitizes a value to uppercase

Methods

public function __invoke( string $input );

Filter\Sanitize\UpperFirst

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\UpperFirst

Sanitizes a value to ucfirst

Methods

public function __invoke( string $input );

Filter\Sanitize\UpperWords

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\UpperWords

Sanitizes a value to uppercase the first character of each word

Methods

public function __invoke( string $input );

Filter\Sanitize\Url

Source on GitHub

  • Namespace

    • Phalcon\Filter\Sanitize
  • Uses

  • Extends

  • Implements

Phalcon\Filter\Sanitize\Url

Sanitizes a value url

Methods

public function __invoke( mixed $input );