• News
  • Developer information
  • Projects & contributions
  • Forum
  • Issue tracker
  • Open Funding
  • Security
  • User groups
  • Support
  • Store
  • Company

  • Path

    ez.no / exponential / documentation / development / libraries / ez template / operators / logical handling


    Logical handling

    These documentation pages are no longer maintained. Please visit the new documentation site.

    Logical operators

    ne

    From eztemplatelogicoperator.php:

    Returns true if one or more of the input parameters does not match. Matching is casual meaning that an integer of value 0 will match a boolean of type false.

    lt

    Returns true if the input value is less than the first parameter. E.g.

    {1|lt(2)}

    returns true.

    gt

    Returns true if the input value is greater than the first parameter. E.g.

    {2|gt(1)}

    returns true.

    le

    Returns true if the input value is less than or equal to the first parameter. E.g.

    {1|le(1)}

    and

    {1|le(2)}

    returns true.

    ge

    Returns true if the input value is greater than or equal to the first parameter. E.g.

    {1|ge(1)}

    and

    {2|ge(1)}

    returns true.

    eq

    Returns true if the input value is equal to the first parameter, or if no input value is available it returns true if all parameters are equal. E.g.

    {1|eq(1)}

    returns true.

    {eq(1,true(),false()|not,0|inc)}

    returns true.

    null

    Returns true if the input value is null, which is not the same as 0. E.g.

    {0|null()}

    returns false.

    not

    Returns true if the input value is false. E.g.

    {false()|not()}

    returns true.

    true

    Creates a true boolean. Remember to use brackets, e.g.

    {true()}

    false

    Creates a false boolean. Remember to use brackets, e.g.

    {false()}

    or

    Evaluates all parameter values until one is found to be true, then returns that value.
    The remaining parameters are not evaluated at all.
    If there are no parameters or all elements were false it returns false. E.g.

    {or(false(),false(),true(),false())}

    returns true.

    and

    Evaluates all parameter values until one is found to be false, then returns that value.
    The remaining parameters are not evaluated at all. If there are no parameters it returns false,
    if no elements were false it returns the last parameter value. E.g.

    {and(false(),false(),true(),false())}

    returns false.

    choose

    Uses the input count to pick one of the parameter elements. The input count equals the parameter index. E.g.

    {0|choose("a","b","c")} returns "a".

    contains

    Returns true if the first parameter value is found in the input value, which must be an array.
    Currently it works the same way as the PHP function in_array() but it may later be extended to support more advanced matching. E.g.

    $array|contains($myvalue)

    Comments

    'contains' does indeed take strings as parameters

    Despite what this page says, as of ez 3.5.1, you can use a string as your "haystack," like so:

    {set myvar='thisisastring'|contains('isastr')}
    and $myvar will == true

    Contents

    Development

    Extensions
    Exponential datamodel
    Exponential tuning and stability
    Importing attribute data
    Kernel
    Libraries
        eZ xml
        eZ db
        eZ i18n
        eZ soap
        eZ template
           Basics
           Functions
           Operators
              Data fetch
              String handling
              Type handling
              Logical handling
              Arithmetics
              Control structure handling
              Array handling
              Image handling
              Miscellaneous
        eZ webdav
    Scripting
    Standards
    System overview
    Test Suite
    Using Doxygen to create API documenta...


    Created

    07/07/2003
    3:34:27 pm
    by Bård Farstad

    Last updated

    23/07/2003
    8:23:15 pm
    by Marco Zinn

    Authors

    Bård Farstad
    Jan Borsodi
    Marco Zinn



    This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.