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

introduce isModuleCurrent method #240

Closed
khorsky opened this issue Dec 8, 2019 · 1 comment
Closed

introduce isModuleCurrent method #240

khorsky opened this issue Dec 8, 2019 · 1 comment

Comments

@khorsky
Copy link
Contributor

@khorsky khorsky commented Dec 8, 2019

Is your feature request related to a problem?

  • I can use $presenter->isLinkCurrent('MyModule:MyPresenter:*')
  • using $presenter->isLinkCurrent('MyModule:*') throws exception

I guess that many had tried to use the analogy for modules - but $presenter->isLinkCurrent('MyModule:*') throws InvalidLinkException. That looks correct to me after thinking for a while - trying to link module (not a presenter from the module) is meaningless.

Anyway I believe there should be a way how to determine the same for modules - can be handy in navigation etc.

Explain your intentions.
Provide a default solution for simple determination that I'm linking from current application module.

It's up to you to make a strong case to convince the project's developers of the merits of this feature.
When framework encourages use of modules, it can be confusing (newcomers included) that one can link to a submodule, can determine linking to current presenter but get an error when using similar notation for modules.

When looking for solution, I found two (first, second) really old related posts in forum.

Anyone can come up with his own solution so when this request is considered inappropriate, I would at least make a remark in documentation (maybe here) that it cannot be used in this way.

@dg
Copy link
Member

@dg dg commented Dec 27, 2019

'MyModule:*' simply means „any action in presenter named MyModule“. It would have to be written like isLinkCurrent('MyModule:*:*') or maybe isLinkCurrent('MyModule:*:'), which is not nice.

So I prefer to create a new method, either isModuleCurrent() or more universal $presenter->getModule().

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

No branches or pull requests

2 participants