Debugging Filter Expressions

October 18th, 2014

If you have a complicated filter expression that may not be working right, you can get a printout of the parse tree. To do this, you add debug="true", e.g.

[cfdb-table form="myform" debug="true"]

For example, if you had 

[cfdb-table form="myform" debug="true" filter="aaa=bbb||ccc=ddd&&eee=fff"]

then you would get a dump like the following, where

  • Tree Level 1 elements are ORed
  • Tree Level 2 elements are ANDed
  • Tree Level 3 elements are comparison expressions

aaa=bbb||ccc=ddd&&eee=fff

parses to:

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [0] => aaa
                    [1] => =
                    [2] => bbb
                )
        )
    [1] => Array
        (
            [0] => Array
                (
                    [0] => ccc
                    [1] => =
                    [2] => ddd
                )
            [1] => Array
                (
                    [0] => eee
                    [1] => =
                    [2] => fff
                )
        )
)

 

Comments are closed.  Go To Support Forum