-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Added activeAccordion method to Accordion.php #2939
base: master
Are you sure you want to change the base?
Conversation
? array_merge($this->variables['open'], Arr::wrap($activeAccordion)) | ||
: $activeAccordion; | ||
|
||
$this->openSet = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the openSet
property in our case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When creating a class, we set a standard key for the first tab in the constructor to preserve the standard previous behavior.
A flag property is needed so that when the method is first called, it can be distinguished whether it was called earlier and, depending on this, merge the array or overwrite it.
/** | ||
* @var array | ||
*/ | ||
protected $variables = [ | ||
'stayOpen' => false, | ||
'open' => [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should aim for more consistency with naming? Since we're calling the method active*
, perhaps it would make sense to also use the key as active
.
Fixes #
Proposed Changes