\n{$tab}\t {$fieldName} true \n{$tab}<% else %>\n{$tab}\t {$fieldName} false \n{$tab}<% end_if %>\n"; } /** * A simple way of drawing a label and value on the template, * e.g. "Sale Price: $SalePrice" * * @param string $fieldName The field name to display * @param string $relationName If a "has_one" related object, make sure to show the value with dot syntax. */ public static function label_and_value($fieldName, $relationName = null) { $tab = self::indent(); $related = ($relationName !== null) ? $relationName."." : ""; self::$tags .= "{$tab}
".FormField::name_to_label($fieldName).": \${$related}{$fieldName}
\n"; } /** * Draw a header field for a new relation * * @param string $relationName The name of the relation shown in this section of the template */ public static function start_relation($relationName) { $tab = self::indent(); self::$tags .= "\n\n{$tab}

".FormField::name_to_label($relationName)."

\n"; } /** * Open a new <% control %> block * * @param string $relationName The subject of the control block */ public static function open_control($relationName) { $tab = self::indent(); self::$tags .= "{$tab}