Validate Plugin

Back to plugins | Download plugin

The Validate plugin adds a method to the API wrapper which provides validation of multiple data types.

The validate() method accepts 4 arguments, of which only the first is required:

  nano('input').validate('string', null, 5, 12);

This would check that the text in "input" is a string, and that it is between 5 and 12 characters in length.

Validation Types

By default, the validate() method checks that the value is not null, undefined, 0, '0', '' or false. The available validation types are:

CodeMessageLineFile
2session_start(): open(/var/cpanel/php/sessions/ea-php82/sess_8247c6b7a4af2d9a4f54ffd075a9fe50, O_RDWR) failed: No such file or directory (2)67/home2/njsorg/public_html/pagetype/cms.php
2session_start(): Failed to read session data: files (path: /var/cpanel/php/sessions/ea-php82)67/home2/njsorg/public_html/pagetype/cms.php
8192Creation of dynamic property PageTypeCMS::$html is deprecated43/home2/njsorg/public_html/pagetype/plugins/html/pagetype.plugin.php