User Tools

Site Tools


pub:vfexpression
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


pub:vfexpression [2022/06/25 17:02] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +<html>&#091;</html>[[ iviewweb | Up To iView 5 Web Interface ]]<html>&#093;</html>
 +
 +
 +
 +
 +====== 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:<html><br/></html>
 +
 +<html><pre></html>
 +if( trim( $fieldValue ) == "Able Anderson" ) return TRUE; else return FALSE;
 +<html></pre></html>
 +<html><pre></html>
 +$u_firstChar = substr( trim( $fieldValue ), 0, 1 );<html><br/></html> 
 +if( $u_firstChar == 'C' || $u_firstChar == 'D' ) return TRUE; else return FALSE;
 +<html></pre></html>
 +
 +A rules specification for the above would look thus:
 +
 +{{pub:iview:vfexpression600.png|}}
 +
 +For more information see [[http://us.php.net/manual/en/function.eval.php]]
 +
 +<html><span style="color: #9C0000; font-weight: bold;"></html>
 +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.<html></span></html>
 +
 +<html><p></html>
 +
 +----
 +
 +<html>&#091;</html>[[ iviewweb | Up To iView 5 Web Interface ]]<html>&#093;</html>
  
pub/vfexpression.txt · Last modified: 2022/06/25 17:02 by 127.0.0.1