PHP Element Validation from php file

black.be3

Member
Hi,
I have PHP element validation that long enough..
I wish php emenent validation also provide option to write validation on file instead only on parameter box.. like on form php plugin..
 
Not 100% sure what you mean, but do you want to replace the submitted value with the result of some PHP code? If so then you should set the 'Match or Replace' option to 'replace' and in your PHP code return the value you want to use as the replacement.e.g:

PHP:
$bar = 'my replacement value';
return $bar;
 
I assume he want's the possibility to run the code from a php script file.

You can do: in the PHP code field put
include '\scripts\test.php';
return $value;

in plugins\fabrik_validationrule\php\scripts (the folder exits already ;)) create your file test.php with
<?php

defined('_JEXEC') or die('Restricted access');
your-long-code;
$value= 'what-you-want-to-return';
?>
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top