Posted October 29th, 2009 |
Published in PHP
I’ve added the following to my Ubiquity config to easily look up PHP functions:
CmdUtils.makeSearchCommand({
name: “php”,
url: “http://uk3.php.net/manual/en/function.{QUERY}.php”,
});
To add this to your Ubiquity setup:
- Open Ubiquity and type help
- On the help page go to the “Hack Ubiquity” menu option
- Paste the above Javascript snippet into the textarea – no need to save, it’s automatic
- Open Ubiquity again and type php urlencode and you’ll be taken to that function’s page
Posted October 8th, 2009 |
Published in PHP
Fabien Potencier with an excellent code snippet for posting to Twitter without using any third-party code or libraries.
http://fabien.potencier.org/article/20/tweeting-from-php
Posted October 8th, 2009 |
Published in PHP
Sensio Labs (the Symfony creators) have released a new PHP templating engine.
Why would they bother when there are already a load of templating engines out there? For a few reasons:
- It’s super fast
- It has a very concise syntax
- It has either automatic or user-specified escaping of output variables
I’ve been using Smarty up to now. It’s mostly been great but I’ve been bitten a few times by it’s sometimes difficult looping syntax, I’ve sometimes had to re-structure arrays in my controllers to get Smarty to iterate them properly.
I’m defintely going try Twig out on my next project – I may even convert my current project to use it (cos, you know, there isn’t a ton of stuff to do on it anyway). Plus, it’ll no doubt be in Symfony very soon and so will get a lot of testing and support.
Fabien Potencier writes an interesting article about PHP templating engines and says why he doesn’t consider PHP itself to be a templating language – it’s too verbose. Up until reading that I was thinking of dropping Smarty and just using plain old PHP but he’s points made me realise that would be a bad idea. So, Twig it is.
The Twig website.
Posted September 15th, 2009 |
Published in PHP
I got hit by the “headers already sent” problem again the other week. I tend to dip in and out of PHP and I keep forgetting the cause of the problem.
The way to avoid this error is to not include the closing ?> tag in PHP files that only contain code.
This is an recommendation from Zend. That Zend page says, “For files that contain only PHP code, the closing tag (“?>”) is never permitted. It is not required by PHP, and omitting it´ prevents the accidental injection of trailing white space into the response.“
Posted April 23rd, 2009 |
Published in PHP,
design
ProFolio is an elegantly designed portfolio for artists, designers, photographers, or anyone that has creative visual pieces to share. It was designed to be professional, elegant, clean & simple. You will see the background of the page with the unobtrusive portfolio navigation to the left. Simple click on portfolio to view the artist’s work, and the other items will fade as small previews of the artwork fades into focus.
ProFolio is built with HTML instead of Flash so that search engines can add your portfolio to their indexes. It works in Firefox 2+, Internet Explorer 7+, Safari. ProFolio is also easily customized, extremely simple to install. However, it’s free for a limited time only.
