Splitting registration methods
This commit is contained in:
parent
c2030384f0
commit
814993936e
|
@ -48,14 +48,36 @@ class BindEclLitePlugin implements \bhl_bind\BindPlugin
|
|||
return '';
|
||||
}
|
||||
|
||||
function codegenRegisterDecls(\Twig\Environment $twig)
|
||||
{
|
||||
$sliced = \bhl_bind\slice_units($this->units, 20);
|
||||
|
||||
$code = '';
|
||||
|
||||
foreach($sliced as $idx => $units)
|
||||
{
|
||||
$code .= "public static void Register_Ecslite_$idx(Types types)\n";
|
||||
$code .= "{\n";
|
||||
|
||||
foreach($units as $u)
|
||||
{
|
||||
if($u->object->hasToken('bhl_ecslite_component'))
|
||||
$code .= $twig->render('bind_ecslite.twig', ['unit' => $u->object]);
|
||||
}
|
||||
$code .= "\n}\n";
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
function codegenRegister(\Twig\Environment $twig)
|
||||
{
|
||||
$sliced = \bhl_bind\slice_units($this->units, 20);
|
||||
|
||||
$code = '';
|
||||
foreach($this->units as $u)
|
||||
{
|
||||
if($u->object->hasToken('bhl_ecslite_component'))
|
||||
$code .= $twig->render('bind_ecslite.twig', ['unit' => $u->object]);
|
||||
}
|
||||
foreach($sliced as $idx => $units)
|
||||
$code .= "Register_Ecslite_$idx(types);\n";
|
||||
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue