On 19.11.2010, at 13:09, Pascal wrote: > Guillermo, > > This option is indeed rly interesting and has already been discussed here : > > https://groups.google.com/group/symfony-devs/browse_thread/thread/105e3295b4ed325d/bee601eb9ac0b290 > > https://groups.google.com/group/symfony-devs/browse_thread/thread/ed6b91413c63f074/346d84ffe30c40d1 > > Solution has not been found yet, looks like it's not so easy to implement.
henrik just gave me a link to how the rails guys are thinking to do it: http://yehudakatz.com/2010/09/07/automatic-flushing-the-rails-3-1-plan/ just like henrik i am not a ruby guy so i dont get all they are doing. but it got me thinking. first up to make this all worthwhile you need to use a model which jordi and I called "pull templates" during our symfony live presentation. that is the work done inside the controller is the bare minimum to figure out what template should be loaded first. so for example you will figure out that the requested document exist in the database, but you dont start fetching all sorts of expensive related content. now once you are inside a twig template you have stuff like blocks and extends. so with twig it should be possible to travel upto the most outer extend. we could also make it possible to "tag" blocks, f.e. "javascript", "css", .. now in the most outer layout we can then have "yield" calls that basically say if all blocks tagged with the given yield label have been processed, then flush up to this point. so essentially twig could process blocks inside the templates in a different order than like they are actually defined in order to more quickly be able to push out content. the blocks would each "pull" in the content that they need, thereby delaying expensive calls as long as possible. obviously the tricky bit is blocks that have dependencies. aka one block defining a variable that is used later on. i guess twig could also detect that sort of thing and at least issue a warning. in the project jordi and I did we also ended up with a lot of static method calls to pull content which neither of us really liked, but maybe this is better solved with proxies or closures. also of course this will not make things magically work, but following a few best practices should ensure that this can provide benefits. anyway, not really thought out in depth. just brain storming .. regards, Lukas Kahwe Smith [email protected] -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
