Permalink
Browse files

register extension method

  • Loading branch information...
1 parent ddd22a3 commit ce30bad30ed951e58110b3b8a224d96bdd699e27 @juzna committed Aug 1, 2012
Showing with 14 additions and 0 deletions.
  1. +7 −0 DatePicker.php
  2. +7 −0 composer.json
View
@@ -248,4 +248,11 @@ private function extractRangeRule(Forms\Rules $rules)
return array($controlMin, $controlMax);
}
+
+
+ // extension method
+ public static function _addDatePicker(\Nette\Forms\Container $container, $name, $label = NULL)
+ {
+ return $container[$name] = new DatePicker($label);
+ }
}
View
@@ -30,6 +30,13 @@
"assets-optional": {
},
+ "extension-methods": [
+ {
+ "class": "Nette\\Forms\\Container",
+ "method": "addDatePicker",
+ "callback": "JanTvrdik\\Components\\DatePicker::_addDatePicker"
+ }
+ ],
"extras": [ "jQuery", "jQuery-UI" ]
}
}

0 comments on commit ce30bad

Please sign in to comment.