-
Notifications
You must be signed in to change notification settings - Fork 140
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
renderdata() enhancement #328
Comments
The current assumption is that "rendering" produces something that can be passed to One way I can think of is to allow for
This would also have the side effect of allowing an overridden Thoughts? Is that too "clever"? |
If users have to write a closure, then what is the benefit over just uising cfcontent + cfabort directly? Also (and this is a somewhat new consideration), a user would either use X-Sendfile if he runs Apache, or X-Accell if he uses Nginx or cfcontent if neither is supported. The choice between them should be driven from the FW/1 config and not be put in the closure code. So I am more thinking along the lines of just adding a third argument to renderData for the MIME type and then putting logic in to check the FW/1 (environment) configuration whether X-Sendfile or X-Accell are enabled. If one of them is, use it, else fall back to cfcontent. |
The reason I suggested the UDF/closure is because nothing in FW/1 uses Adding additional arguments that are conditionally used (what would If there are certain, standard, file-processing behaviors, then FW/1 could provide UDFs that encapsulated those, for use as I'd be interested to see a PR with the code changes for what you are proposing so we'd have something concrete to review (but right now I'm not 100% sure exactly what you are proposing, especially around the send file / accell config). |
I was discussing the idea of allowing the JSON serialisation to be switched out (as SerializeJSON has several known issues on ACF!). Adding a comment here as it's loosely related. My thinking was to do a simple public Looking through the code for 4.0 I can see that there is a move towards using a builder where you could pass in a function to handle this instead. |
This allows custom renderers for built-in types by overriding the render_{type}() function or supplying a function or closure for the renderData() type argument.
|
This allows onMissingView() to control content type as well as renderData().
|
In 3.1 devel a new renderData type "rawjson" is supported. I can think of at least 3 more types I would want:
Compared to the existing renderData they all have the problem they need more arguments since you need to pass in a mime-type as well. So might it be an idea to somehow make this extensible?
Discussion at https://groups.google.com/forum/#!topic/framework-one/aY5Ct68IbdE
The text was updated successfully, but these errors were encountered: