1

Is there a way to implement the "pagelets" concept using PHP as Facebook does? From their blog post:

BigPipe is a fundamental redesign of the dynamic web page serving system. The general idea is to decompose web pages into small chunks called pagelets, and pipeline them through several execution stages inside web servers and browsers. This is similar to the pipelining performed by most modern microprocessors: multiple instructions are pipelined through different execution units of the processor to achieve the best performance. Although BigPipe is a fundamental redesign of the existing web serving process, it does not require changing existing web browsers or servers; it is implemented entirely in PHP and JavaScript.

Pagelets in Facebook home page; each rectangle corresponds to one pagelet:

Pagelets in Facebook home page. Each rectangle corresponds to one pagelet.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • 1
    I've edited the post to bring in the relevant part of the Facebook blog entry; it's best to bring everything into the question, to avoid forcing your readers to click on external items. – halfer Jul 08 '12 at 12:56

3 Answers3

2

Is there a way to implement pagelets concept using PHP

No. It barely has something to do strictly with the server-side (PHP).

That is done in Javascript on the client (browser).

Flavius
  • 13,566
  • 13
  • 80
  • 126
0

It appears that FB is referring to what is called the widget problem in MVC design. So this certainly appears backend, but the question is extremely open ended and impossible to answer.

I'd say go checkout some HMVC frameworks that allow you to do this.

Aditya M P
  • 5,127
  • 7
  • 41
  • 72
  • On second reading of that post, there appears to be quite a bit of JavaScript involved in the process also... but I'd disagree with the claim that it is purely front-end. – Aditya M P Jul 08 '12 at 12:21
  • Can you provide some reference for *"the widget problem in MVC design"*? – hakre Jul 08 '12 at 14:21
  • http://net.tutsplus.com/tutorials/php/an-introduction-to-views-templating-in-codeigniter/ - The second part, 'Templating Views', discusses the problems faced with just the usual MVC scheme. Also, check this out: http://stackoverflow.com/q/3675135/443219 The CI forum is full of these threads. – Aditya M P Jul 09 '12 at 01:37
  • Even the word *"widget"* is not part of the tutsplus text. With reference I meant something *authorative*, otherwise you're just dropping words here with no reference. -1 for that. And layouts / partials is a different wording than widgets. And AFAIK this is a different meaning. – hakre Jul 09 '12 at 12:27
  • Congratulations, looks like you're quest for adding a -1 on any mere technicality has been successful. I hope the rest of your day remains this lucky. – Aditya M P Jul 09 '12 at 12:31
  • Come on, you wrote that something is called *"the widget problem in MVC design"* without *any* reference. Sorry, but why didn't you call it the problem of seeing a rainbow supernova in binary woods? – hakre Jul 09 '12 at 14:13
  • I'd read it in a couple of forum threads on the CI website, it was a while back. It described the problem of 'embedding multiple partial views from the same controller without repeating yourself' quite concisely. So I used it. Take it easy... not *everything* absolutely needs references! I didn't call it whatever it is you're suggesting - because it's not *that* - it's `the widget problem`, quite simply. – Aditya M P Jul 09 '12 at 14:49
  • The problem to embed multiple views is a natural one in CI because CI is desgined that way. No support for actual views. There is a representational layer that is CI controller and CI view. There is not much difference how you name it. So I would step far away from calling that a widget problem, it's a Codeigniter design problem you speak about here. That is totally unrelated to what the OP asks for. So hopefully you now understand what I'm concerned about. – hakre Jul 09 '12 at 15:38
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/13622/discussion-between-aditya-menon-and-hakre) – Aditya M P Jul 09 '12 at 15:41
-1

The concept of pagelets is totally unrelated to PHP, however as you can do as well 3D graphics in PHP, there sure is a way to implement such a concept in PHP.

While you're at it, I would also suggest to implement the user-agent in PHP as well, so you can develop a cross-client-server-platform-pagelet implementation in PHP totally.


You might be looking for so called EDGE Side Includes for which you can find a PHP implementation in the Symfony2 framework. This also needs a server component, like Varnish or Squid.

hakre
  • 193,403
  • 52
  • 435
  • 836