Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Requested JsHelper buffer #156

Closed
wants to merge 20 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

challet commented Jul 22, 2011

hello CakePHP team.

While switching to the JsHelper, which is great to optimize the javascript code.
I had a problem with string bufferised from a requested action : the two requests (main one [http] and second one [requested] ) have each their buffer and it's not shared.
So some Js strings from requested ones are not in the main output.

I guess it's a known beahvior (each request have their own helpers). But if you consider to change this (at least for the Js Helper buffer), here is a patch to do this :

  • the "main" JsHelper register itself when beforeRender
  • the "requested" ones transmit their buffer to the "main" one, on their own afterRender

At the end, the "main" JsHelper collected all the buffers in one and can output it.

Contributor

challet commented Jul 22, 2011

Sorry, only the last commit is to be taken into account : PathMotion/cakephp@4d9afe8

I don't know how to put only this one here :/

@markstory markstory commented on the diff Jul 23, 2011

cake/libs/model/datasources/datasource.php
@@ -223,7 +223,7 @@ class DataSource extends Object {
* @return array Array of sources available in this datasource.
* @access public
*/
- function listSources($data = null) {
+ function cachedListSources($data = null) {
@markstory

markstory Jul 23, 2011

Owner

Won't this break a pile of backwards compatibility?

Owner

markstory commented Jul 23, 2011

Seems like there are a bunch of other changes that are not part of the original pull request in here as well. Putting things on separate branches makes the pull requests work better.

@markstory markstory closed this Jul 23, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment