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

Presenter: added isModuleCurrent() [Closes #240] #243

Merged
merged 1 commit into from Jan 3, 2020
Merged

Presenter: added isModuleCurrent() [Closes #240] #243

merged 1 commit into from Jan 3, 2020

Conversation

khorsky
Copy link
Contributor

@khorsky khorsky commented Jan 2, 2020

@dg
Copy link
Member

dg commented Jan 2, 2020

Thanks.

What do you think about change name to isInModule() (or something similar), because isModuleCurrent sounds to me like an exact match.

@khorsky
Copy link
Contributor Author

khorsky commented Jan 2, 2020

In template I would read $presenter->isModuleCurrent(<some-module-name>) as "is given module current" - that seems logical to me.

Your proposal makes sense too (line of code saying "is this presenter in the module XY"). Despite that I do not "like it". When trying to find a better name I refused

  • isInModule - does not work for me, see bellow
  • isSubmodule - tells another story
  • isModulePart / isModuleRelated - these are desperate attempts

I would stick to $presenter->isModuleCurrent. It came to my mind as first option when I was looking for the behavior (I was looking for "isLinkCurrent for modules").

It's similar in name and similar in usage. The most beneficial use case is probably to mark navigation item as active/current. I tried to use "isInModule" in the template with this use case - it looks strange...

@dg
Copy link
Member

dg commented Jan 3, 2020

Ok :-)

@dg dg merged commit 23d1851 into nette:master Jan 3, 2020
dg pushed a commit that referenced this pull request Jan 3, 2020
dg pushed a commit that referenced this pull request Jan 3, 2020
dg pushed a commit that referenced this pull request Jan 4, 2020
dg pushed a commit that referenced this pull request Jan 4, 2020
dg pushed a commit that referenced this pull request Jan 4, 2020
@khorsky khorsky deleted the is-module-current branch January 4, 2020 20:50
dg pushed a commit that referenced this pull request Jan 5, 2020
dg pushed a commit that referenced this pull request Jan 5, 2020
dg pushed a commit that referenced this pull request Jan 5, 2020
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.

None yet

2 participants