Prev | Current Page 504 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

More than one attribute
can be defined in a single attr expression; each additional attribute name and value pair must be
separated from the previous one by using a semicolon ; symbol.
When used in an XHTML context, the attr expression is smart enough to transform a Boolean value in
its corresponding attribute format; as in the following expression:
< input type=???checkbox??? name=???checkme??? ::attr checked isChecked::/ >
It will be transformed in the following if the isChecked variable is set to true .
< input checked=???checked??? name=???checkme??? type=???checkbox???/ >
If the variable value is false the attribute is omitted entirely.
< input name=???checkme??? type=???checkbox???/ >
That is particularly important because the output is maintained clean with very little effort.
Raw Expressions
As previously introduced, all the special characters in an expression result are automatically converted
in their corresponding entities. The raw expression just prevents this behavior by displaying the content
of an unchanged variable.


Pages:
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516