-
-
Notifications
You must be signed in to change notification settings - Fork 115
Comments
LinkGenerator: accept classname in $dest#296
Draft
mabar wants to merge 22 commits intonette:master from
Draft
Conversation
Member
dg
commented
Sep 26, 2021
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 \.
Contributor
Author
mabar
commented
Sep 26, 2021
I wrote an regex which expects [[Class\Name:]action] [#fragment] and all the tests on regex101.com work (check the unit tests tab). But I cannot get it work in PHP, it does not match my test string App\Admin\User\List\UserListPresenter:default, not sure why :/
https://regex101.com/r/u2DneV/1
Contributor
Author
mabar
commented
Sep 26, 2021
Okay, got it. Had to add some character classes. Seems like regex101 does not use php, just PCRE2 - regex with [\\] and \\ works with regex101, [\\\] works with php
@dg
dg
force-pushed
the
master
branch
3 times, most recently
from
October 6, 2021 23:39
cb29fc4 to
ef31716
Compare
@dg
dg
force-pushed
the
master
branch
3 times, most recently
from
June 19, 2025 16:47
3463b9a to
ee24f8e
Compare
@dg
dg
force-pushed
the
master
branch
4 times, most recently
from
July 17, 2025 22:42
ddf16b5 to
87e4597
Compare
@dg
dg
force-pushed
the
master
branch
10 times, most recently
from
November 30, 2025 23:13
c62f26c to
e72b735
Compare
@dg
dg
force-pushed
the
master
branch
3 times, most recently
from
December 23, 2025 22:32
f536135 to
4e8f41d
Compare
@dg
dg
force-pushed
the
master
branch
2 times, most recently
from
December 28, 2025 23:56
c478b71 to
44181e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 alsoPresenterFactoryand 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.