Skip to content
Browse files

added macro {pair control}

  • Loading branch information...
1 parent 6cccc2d commit fa4804a163249e27aa5a39853ededdbe4f57f2cb @juzna committed Mar 19, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 FormMacros.php
View
12 FormMacros.php
@@ -129,6 +129,17 @@ public static function input($name, $modifiers) {
echo $input;
}
+ public static function macroPair($content) {
+ list($name, $modifiers) = self::fetchNameAndModifiers($content);
+ return "Addons\Forms\FormMacros::pair($name, $modifiers)";
+ }
+ public static function pair($name, $modifiers) {
+ $control = self::getControl($name);
+ echo self::getForm()->getRenderer()->renderPair($control);
+ }
+
+
+
// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="{label}">
@@ -178,6 +189,7 @@ public static function register() {
LatteMacros::$defaultMacros["formErrors"] = '<?php %Addons\Forms\FormMacros::macroFormErrors% ?>';
+ LatteMacros::$defaultMacros["pair"] = '<?php %Addons\Forms\FormMacros::macroPair% ?>';
LatteMacros::$defaultMacros["input"] = '<?php %Addons\Forms\FormMacros::macroInput% ?>';
LatteMacros::$defaultMacros["label"] = '<?php %Addons\Forms\FormMacros::macroLabel% ?>';
LatteMacros::$defaultMacros["inputValue"] = '<?php %Addons\Forms\FormMacros::macroInputValue% ?>';

0 comments on commit fa4804a

Please sign in to comment.
Something went wrong with that request. Please try again.