Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Widgets should have a name assigned (otherwise a default one will be assigned) and may accept arguments.

 

Code Block
languagephp
$label = new \Shared\Wui\WuiLabel(
  ‘mylabel’,
  [‘label’ => ‘Test’, ‘bold’ => ‘true’]
);

...

A container is like a widget but it also supports adding children, e.g.: 

Code Block
languagephp
$group = new \Shared\Wui\WuiHorizgroup(‘mygroup’, [‘width’ => ‘100%’]);
$label = new \Shared\Wui\WuiLabel(‘mylabel’, [‘label’ => ‘Test’]);
$group->addChild($label);

...

Form elements are normal widgets that must be children at some level of a “form” container: 

Code Block
languagephp
$form = new \Shared\Wui\WuiForm(‘task’, []);
$string = new \Shared\Wui\WuiString(‘name’, [‘disp’ => ‘action’, ‘value’ => ‘My test’]);
$form->addChild($string);

...

WUI widget structures can also be defined using nested XML tags that are automatically converted to WUI objects, using the standard WuiXml widget: 

Code Block
languagephp
$xml = ‘<vertgroup><!-- this is a container -->
  <children>
    <label><!-- this is a widget -->
  <args>
  <label>My label</label>
      <bold>true</bold>
      </args>
    <label>
  <label><!-- this is another widget -->
  <args>
  <label>Other label</label>
  </args>
  <label>
  </children>
</vertgroup>’;
 
$wui = new \Shared\Wui\WuiXml(‘xml’, [‘definition’ => $xml]);

...