ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
LangFactory.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
29 
30 class LangFactory extends BaseFactory
31 {
33 
34  public function __construct(
38  DataHelperInterface $data_helper
39  ) {
40  parent::__construct($ui_factory, $presenter, $constraint_dictionary);
41  $this->data_helper = $data_helper;
42  }
43 
44  protected function rawInput(
45  ElementInterface $element,
46  ElementInterface $context_element,
47  string $condition_value = ''
48  ): FormInput {
49  $langs = [];
50  foreach ($this->data_helper->getAllLanguages() as $key) {
51  $langs[$key] = $this->presenter->data()->language($key);
52  }
53  return $this->ui_factory->select('placeholder', $langs);
54  }
55 }
This is what a factory for input fields looks like.
Definition: Factory.php:28
__construct(UIFactory $ui_factory, PresenterInterface $presenter, ConstraintDictionary $constraint_dictionary, DataHelperInterface $data_helper)
Definition: LangFactory.php:34
__construct(VocabulariesInterface $vocabularies)
rawInput(ElementInterface $element, ElementInterface $context_element, string $condition_value='')
Definition: LangFactory.php:44
string $key
Consumer key/client ID value.
Definition: System.php:193
This describes inputs that can be used in forms.
Definition: FormInput.php:31