User Tools

Site Tools


pub:vfexpression

[ Up To iView 5 Web Interface ]

Using *EXPRESSION in Virtual Folders

Using the *EXPRESSION rule type, you may key up to 1024 characters of valid Php code in the 'Comparison Value' field. iView 5 will feed this string to the Php eval() function and return its value.

  • The code must be valid Php.
  • Do not enclose the code in quotes - eval() would evaluate that as a string and return NULL.
  • You may reference the archive index field value using the variable $fieldValue. You may want to trim() this value.
  • The code must use return, and should return TRUE, FALSE, or something that the Php interpreter will evaluate to TRUE or FALSE.
  • Prefix all variables you use, except $fieldValue, with u_. Thus you might have variables named $u_firstChar. This is to avoid name conflicts.

Examples:

if( trim( $fieldValue ) == “Able Anderson” ) return TRUE; else return FALSE;
$u_firstChar = substr( trim( $fieldValue ), 0, 1 );
if( $u_firstChar == 'C' || $u_firstChar == 'D' ) return TRUE; else return FALSE;

A rules specification for the above would look thus:

For more information see http://us.php.net/manual/en/function.eval.php

The ability to paste any Php code into this field is a glaring security and data integrity issue and administration of Virtual Folders should be restricted as appropriate.


[ Up To iView 5 Web Interface ]

pub/vfexpression.txt · Last modified: 2022/06/25 17:02 by 127.0.0.1