Blog posts tagged with symfony
Reply to PHP 5.3 and the Future
Mark Evans wrote on his blog interesting post about PHP 5.3 and the Future. I guess the main concern here is similar we used to have with PHP4 to PHP5 migration (GoPHP5 campaign). Mark raised three questions to the community which I'd like to reply to.
Using SimpleXML with sfWebBrowser to parse html documents
sfWebBrowser is a class that emulates browser calls. It gives us nice object oriented interface to navigate through document structure in a programmed way. It can return response as SimpleXML which enables us to use xpath queries on the document being parsed. Unfortunately html pages are hardly ever XML valid documents. That's why in most cases sfWebBrowser rather throws and exception than returns something. Here is how we can write a workaround for it.
Put your stylesheets at the top and your scripts at the bottom
Putting the stylesheets at the top of your web page and moving the scripts to the bottom are only two of thirty four rules described in Best Practices for Speeding Up Your Website (by Yahoo). Following these two rules, however, can really decrease visible time of page rendering. I will present a simple solution to achieve this in symfony framework.
Looking at the website's source code
Most of the web programmers have some kind of deviation that tells them to look into the source code of the websites they visit. In many cases author planned to have nice indented output. In other cases author just didn't care.
















