diff --git a/sources/PropertyTree/Property.php b/sources/PropertyTree/Property.php index 99982854d..1a8a804df 100644 --- a/sources/PropertyTree/Property.php +++ b/sources/PropertyTree/Property.php @@ -34,7 +34,11 @@ class Property extends AbstractProperty $sInputs = ''; foreach ($this->oValueType->GetInputs() as $sInput => $sValue) { - $sInputs .= "\n ->SetInputValue('$sInput', '$sValue')"; + if (preg_match("/^{{(?\w+)\.(?\w+)}}$/", $sValue, $aMatches) === 1) { + $sInputs .= "\n ->InputDependsOn('$sInput', '{$aMatches['node']}', '{$aMatches['output']}')"; + } else { + $sInputs .= "\n ->SetInputValue('$sInput', '$sValue')"; + } } return <<UI:ClassAttribute Contact + Test @@ -297,6 +298,43 @@ PHP, 'sMessage' => '', ], + 'Input binding' => [ + 'sXMLContent' => << + + + + + + + + + + + {{class_property.text}} + + + + +XML, + 'sExpectedPHP' => <<Add('class_property', 'Combodo\iTop\Forms\Block\Base\TextFormBlock', [ + 'label' => 'UI:Class', + ]); + + \$this->Add('class_attribute_property', 'Combodo\iTop\Forms\Block\DataModel\AttributeChoiceFormBlock', [ + 'label' => 'UI:ClassAttribute', + ]) + ->InputDependsOn('class', 'class_property', 'text'); + } +} +PHP, + 'sMessage' => '', + ], 'test' => [ 'sXMLContent' => <<