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

Extend syntax used in link() method of LinkGenerator #328

Closed
wants to merge 29 commits into from

Conversation

mildabre
Copy link
Contributor

Proposed changes make possible to use in LinkGenerator the same syntax as in presenter - links started with //: or :

In the current version of LinkGenerator it is not possible to use for $destination in method link() syntax :Module:Presenter:action or //:Module:Presenter:action as in presenter.

The proposed changes make possible to use this syntax in LinkGenerator also, withou any BC break, because the current syntax Module:Presenter:action will remain in function.

The proposal is also discussed on Nette formu in this post: https://forum.nette.org/cs/36468-rfc-rozsirit-syntaxi-parametru-destination-v-metode-linkgenerator-link#p226631

dg and others added 29 commits April 6, 2024 19:19
Warning doesn't catch that {_} doesn't work either
- inteface Nette\Application\IRouter replaced by Nette\Routing\Router
…e() for persistent parameters. [Closes nette/nette#703][Closes nette/nette#703][Closes #69]" (possible BC break)

This reverts commit cda17f4.

See https://forum.nette.org/cs/35528-stejne-pojmenovany-parametr-akce-presenteru-a-persistentni-odlisne-chovani-v-nette-2-0-oproti-aktualnimu#p221742

BC break: Property must be nullable, ie: #[Persistent] public ?int $foo
Proposed changes make possible to use in LinkGenerator the same syntax as in presenter - links started with //: or :
@mabar
Copy link
Contributor

mabar commented Apr 10, 2024

Also discused in #255
This would be really welcomed feature :)

Some tests would be nice - https://github.com/nette/application/blob/30d90f4fca1df8face66b6963308935319413bfd/tests/Routers/LinkGenerator.phpt

Btw, whats the @ for? Never saw that syntax

@stpnkcrk
Copy link

stpnkcrk commented Apr 10, 2024

@mabar experimental link aliases I believe.

https://forum.nette.org/en/36451-nette-application-3-2-aliases-for-links

@dg dg force-pushed the master branch 2 times, most recently from bbea2e4 to db6b14f Compare April 15, 2024 00:28
@dg
Copy link
Member

dg commented Apr 16, 2024

In branch 3.2-dev the link generation in presenters and LinkGenerator is merged and the syntax is identical.

@dg dg force-pushed the master branch 4 times, most recently from bf86204 to c91f90a Compare April 20, 2024 00:46
@dg dg closed this Apr 24, 2024
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.

4 participants