diff --git a/src/bind.inc.php b/src/bind.inc.php index 5ea33e3..518ec8d 100644 --- a/src/bind.inc.php +++ b/src/bind.inc.php @@ -43,6 +43,8 @@ function codegen( $options['register_class'] = 'BHL_AutoBindings'; if(!isset($options['namespace'])) $options['namespace'] = 'bhl'; + if(!isset($options['custom_code'])) + $options['custom_code'] = ''; if(isset($options['plugins'])) { diff --git a/tpl/codegen_autobind.twig b/tpl/codegen_autobind.twig index ea43fa1..b54659b 100644 --- a/tpl/codegen_autobind.twig +++ b/tpl/codegen_autobind.twig @@ -3,12 +3,15 @@ using System; using System.Collections; using System.Collections.Generic; +using bhl; #if !BHL_FRONT {%- for imp in imports ~%} using {{imp}}; {%- endfor ~%} #endif +{{custom_code}} + {% import "bhl_bind_macro.twig" as macro %} namespace {{namespace}} {