Skip to content

Support multiple shows#19

Merged
DaveZMB merged 4 commits intodevfrom
feature/support-multiple-shows
Nov 10, 2022
Merged

Support multiple shows#19
DaveZMB merged 4 commits intodevfrom
feature/support-multiple-shows

Conversation

@anbinh
Copy link
Copy Markdown

@anbinh anbinh commented Nov 4, 2022

Ref

// This doesnt work and only formats that last time with the show even though they are different api show lines.
$content = $cms->get(array(
  'module'  => 'smallgroup',
  'display' => 'list',
  'order' => 'recent',
  'emailencode' => 'no',
  'show' => "___starttime format='g:ia'__",
  'show' => "__endtime format='g:ia'__",
));

Actually, the array() is the way to initialize PHP Associative Array (https://www.php.net/manual/en/language.types.array.php). It has the format of key => value. The key should be unique. That's why it formats the last show line because only the last line is chosen.

This PR supports multiple shows by wrapping it inside an array. So the syntax looks like this

$content = $cms->get(array(
  'module'  => 'smallgroup',
  'display' => 'list',
  'order' => 'recent',
  'emailencode' => 'no',
  'howmany' => 1,
  'page' => 1,
  'show' => [
    "__starttime format='g:ia'__",
    "__endtime format='g:ia'__"
  ]
));

The inline option is working as usual 'show' => "___starttime format='g:ia'__ __endtime format='g:ia'__",

@anbinh anbinh requested a review from a team November 4, 2022 13:36
@DaveZMB DaveZMB merged commit e7f6726 into dev Nov 10, 2022
@DaveZMB DaveZMB deleted the feature/support-multiple-shows branch November 15, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants