Comments (7)
Main problem here is that actionX does not always continue renderX. Rendering view X by renderX after actionX is default but actionX can freely choose what view it will render.
from application.
I mean, the documentation says render<View>() OR action<Action>()
from application.
Yes, but human language is not a programming language with short-circuit evaluation. I have a black and white pencil and I say you: Choose black pencil or white pencil. Do I mean that you can't choose white pencil?
However, It is still quite unexpected and vulnerable to easily broke the application.
from application.
Do you have any suggestions on how to improve the documentation text?
from application.
I see that you are refusing to even consider or discuss that the code itself could be potentially improved and help developers to make less mistakes and keep their code simpler.
Documentation proposal:
At the same time, all parameters specified in the signature of the
action<Action>()
method orrender<View>()
method, if theaction<Action>()
is not defined, are transferred.
In Czech:
Zároveň se přenáší i všechny parametry uvedené v signatuře metody
action<Action>()
nebo metodyrender<View>()
, pokud neníaction<Action>()
definovaná.
from application.
I'm certainly not opposed to improvements, but I can't immediately think of a better way to do it, and at the same time, you're the first person in 15 years to deal with this, so I'm not seeing it as a priority. Even in light of the fact that I don't want to make BC breaks.
from application.
I understand such a change would be BC break and the priority is low. I also understand that creating unified signature for both actionX
and renderX
methods would be problematic – parameters can have different order, the same parameter can be optional in the first method and required in the second, they even can have different types theoretically.
What I do right now, is keeping parameters in both methods identical. Together with warning in comment to remind me that I have to keep parameters always the same. To be honest, after years of development in Nette, I'm quite tired of doing it this way. In one case, I have 10 parameters in actionX
method and none of them are actually used. They are required just to force framework to create links properly.
Another solution is to write all parameters in template explicitly like this:
<a n:href="this param1 => true, param2 => true">refresh</a>
Not cool. In this approach I have to think about it in every single usage.
So let me propose another solution. I can imagine the setting that will control parameters rendering (in a similar way how autoCanonicalize
can be changed). This setting will have options:
- preferActionParams (default, current behavior)
- preferRenderParams (much more useful in real scenarios, in my opinion)
- unifyParams (universal, but maybe too complicated to implement)
from application.
Related Issues (20)
- Nette Request doesn't have FETCH API fix HOT 2
- `UnexpectedValueException` with `$throw` = false on presenter->getComponent
- Route constructUrl incorrectly builds a URL on a non-standard port HOT 1
- BC break in patch version: Component::link() signature
- Routing panel throws exception from UrlScript HOT 1
- Invalid type of parameter in url throws InvalidLinkException HOT 1
- Session-less store/restoreRequest HOT 2
- Persistent attribute used for persistent controls does not allow params with control names
- Combination of nette/application 3.1.7 and nette/utils 3.2.7 triggers a deprecation error in Tracy HOT 7
- Ugly look of Tracy routing bar
- Missing barebone JS library for AJAX/snippet HOT 16
- Link with captured variable and latte strict mode not working HOT 6
- Flash sessions - deprecated getter
- Nette Application 3.1.12 breaks compatibility with Latte 2 HOT 1
- ComponentReflection::convertType() empty string problem
- Custom form macros are overridden by default ones
- Link with a class constant as an argument cannot be parsed
- Tracy red exception page not displayed on BadRequestException HOT 2
- No services of type XyzPresenter found. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from application.