SF2 Demo II

This code is too old for people to want it as a demo.

This is a “few hour demo” for one of the employers I am talking with. I will ask if I may publish the spec. Further reading on Symfony will be published symfony2-overview.
I used the Symfony framework as I had this installed. I can also build this as Zend.
This code has no real purpose, so I won't upload it to any code repo.


  • Get the latest stories from the BBC technology RSS Feed.
  • Reorder the stories into Alphabetical order based on the <title> attribute
  • We would expect to see the image, title, description and a link to the original story displayed in the output
  • Add some ajax to update the feed periodically
  • CSS
  • Unit tests

The notes requested password access. I hate it when there is a little script that wants to authenticate, and then another script, and another. They have no joined-up thinking. Secondly when a htpassword locked script is added into a slightly more centralised framework, but the admin don't delete the htpassword; meaning you need to authenticate twice. The common implementation doesn't allow any mechanism to update the password, and is normally a eight char dictionary word.
Decent security and control takes more thought and planning. As this is framework, there is a higher baseline of features 1, but the failures in process are still present. I have added code to look at a session value, and if that fails, pretend to ask a third party (like openID or Oauth 2 3 ). I don't have time to complete the implementation for this bit.

What is this?

What is this (a technical list) :

  • A Controller, acting as glue code,
  • Linked library SimplePie? to pull and parse RSS data
  • Custom Sort and Iterator to pass data forwards
  • Twig encoded HTML5 templates
  • CSS, (partially via bootstrap) intentionally web2.0 output as I think it matches the output. Must be mobile friendly.
  • unit tests, necessary to complete build.
  • A htaccess to make the URLs easier to type (but not active, as it conflicts with my site htaccess)
  • Simple AJAH via jQuery, I haven't impl much scripting here...
  • if I get time, I will internationalise all the text out of the template.

Concurrent to writing this, I am building the infinite scroll template. If there is alot of items on the RSS, the infinite scroll could be useful.

The AJAH ~ Asynchronous Javascript and HTML ~ is the simple edition, and provides best interaction with the noscript edition. I could build a more complex version that built HTML on the client from JSON, but this means the noscript is useless. If sorting on the client or search was requested, then AJAJ is the best option. The data would be held separate to the DOM, and could be manipulated (in this case sorted).
As I had a spare 5m I added the AJAH update as requested. In practical terms, this feature is valueless, the raw RSS is updated once a day at top rate (look at the build date on the rawdata).

I was going to use virtuvia/sffeed2plugin for the RSS parsing, as it looks better to integrate with, but this doesn't work with composer. The Sortable interfaces seem tied to an ORM, and I didn't want to require an entire ORM for one interface file (either propel or doctrine).

What does this demonstrate?

  • Implementation inside time constraints; I would add more tests, and delete the valueless 'default' classes.
  • Use of MVC and DI concepts.
  • Code integration.
  • Use of Symfony2 framework.
  • Use of HTML5 and PHP5.
  • Use of PHPunit.
  • Basic use of Apache tech tree.
  • Use of CSS. Optimised layout for mobile.
  • Content fairly responsive, but quite low density, so this is easy.
  • Iteration until success.

A competency test really.

What would I ~ the author ~ improve?

  • More cleanup effort.
  • Complete the OO structure.
  • Add the call-to-action on :hover, I have removed many of the indications that the links are links.
  • Implement any security features. I think this is low priority for the above reasons, and that this is rendering public data.
  • Run on mobile, fix anything needed.
  • As you asked for “impressive”, add the internationalisation (add at least two languages to the source).
  • Offer the sort option on the front-end.

Some similar articles in legacy