Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beispiel Widget Medialist #29

Closed
aeberhard opened this issue Nov 30, 2017 · 2 comments
Closed

Beispiel Widget Medialist #29

aeberhard opened this issue Nov 30, 2017 · 2 comments

Comments

@aeberhard
Copy link
Member

Beispiel Medialist auf Basis

$MediaList1 = rex_var_medialist::getWidget($id, $name, $value, $args);
@chrison94
Copy link
Member

chrison94 commented Nov 30, 2017

Mein Beispiel - ist aber ohne $args:

$formElements = [];
$n = [];
$n['label'] = '<label for="REX_MEDIALIST_SELECT[1]">' . $this->i18n('demo_medialist_text') . '</label>';
$medialist =  $this->getConfig('demo_medialist');
$n['field'] =   rex_var_medialist::getWidget(0, 'config[demo_medialist]' ,$medialist);
$formElements[] = $n;

$fragment = new rex_fragment();
$fragment->setVar('elements', $formElements, false);
$content .= $fragment->parse('core/form/container.php');

Und speichern mit

if (rex_post('formsubmit', 'string') == '1') {
    $this->setConfig(rex_post('config', [
        ['demo_medialist', 'string'],
    ]));

@aeberhard
Copy link
Member Author

#55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants