-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
LinkGenerator: accept classname in $dest #296
base: master
Are you sure you want to change the base?
Conversation
There should be a condition that always makes it clear whether it is a class or a presenter, otherwise it could get awkward. For example, a class must contain at least one character |
I wrote an regex which expects |
Okay, got it. Had to add some character classes. Seems like regex101 does not use php, just PCRE2 - regex with |
cb29fc4
to
ef31716
Compare
e3d05b3
to
929a242
Compare
426e735
to
c19ebdc
Compare
2b9da37
to
30d90f4
Compare
bf86204
to
c91f90a
Compare
57bd587
to
e908315
Compare
c5ecbda
to
ecb200c
Compare
This is minimal change needed in Nette in order to support NOT using mapping and to reference class directly instead.
To fully support that behavior also a
class_exists()
check is needed inPresenterFactory
. Without this is my change untestable, so let me know if I should modify alsoPresenterFactory
and write tests.https://github.com/orisai/nette-application/blob/73906f0f3009f751c15d8170467246957ca2e239/src/Mapping/DefaultPresenterFactory.php#L147-L163
I am already able to achieve it with
$this->presenter->link($this->presenter::class . ':default');
.Benefit of this change is presenters don't have to follow any namespace structure, just like any class.