CHAPTER 11 – Flexy Markup Format

So far, you have seen examples of placehold- ers and the {foreach:} construct in Flexy. Table 11.2 gives a full list of the con- structs that Flexy supports. Table 11.2 Flexy Markup Tags Tag Description {variable} This is the regular placeholder. By default, placeholders are {variable:h} encoded by htmlspecialchars(). The :h modifier disables this {variable:u} to pass the raw value through, while the :u modifier encodes with urlencode() instead. {method()} This tag calls a method in the view object and uses the return {method():h} value. As with variables, htmlspecialchars() is used by {method():u} default, and you can use the :h and :u modifiers. {if:variable} If statements are available, but only with Boolean tests no {if:method()} arbitrarily complex logic. ifs are limited to variables, method {if:!variable} calls, and negation. {if:!method()} {else:} The else tag must be used with {If:}. {end:} The {end:} tag is used to finish both {foreach:} and {If:}. {foreach:arr,val} Corresponds to PHP's foreach. The first variation iterates {foreach:arr,ind, over arr and assigns each element in turn to val. The second val} variation assigns the array index to ind as well.

Post Comment
Login to post comments