Skip to content

kreatifIT/mform_helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mform_helpers

Das Addon stellt einige Hilfsfunktionen für das MForm Addon bereit.

Beispiele

<?php

$mform = \Kreatif\Project\MForm::factory();

$mform->addTab(function (\Kreatif\Project\MForm $tab) {
    $tab->addTitleTextField();
    $tab->addDefaultLinkField();
});
echo $mform->showWithSettings();
<?php

$mform = new \Kreatif\Project\MForm();

$mform->addTab(function (\Kreatif\Project\MForm $tab) {
    $tab->addTitleLargeField();
});
$mform->addMBlockTab(function (\Kreatif\Project\MForm $tab, $id) {
    $tab->addImageField();
    $tab->addTitleLargeField($id);
    $tab->addTitleSmallField($id);
    $tab->addSimpleTextField($id, 'year');
    $tab->addDefaultTextField($id);
    $tab->addDefaultLinkField($id);
}, [
    'item_label' => 'fact',
    'tab_label' => 'facts',
]);

echo $mform->showWithSettings();
<?php

use RexGraphQL\Type\Reference;

$mform = new \Kreatif\Project\MForm();

$mform->addTab(function (\Kreatif\Project\MForm $tab) {
    $tab->addTitleLargeField();

    $references = Reference::getQuery()->find();
    $options = [];
    foreach ($references as $reference) {
        $options[$reference->getId()] = $reference->getName();
    }
    $tab->addSelectField("1.reference_ids", $options, ['multiple' => true, 'label' => rex_i18n::msg('label.select_references')]);
});
echo $mform->showWithSettings();

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages