LinkGenerator: accept classname in $dest #296
Draft
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 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.