On template “tag soup”

Tags:

Jeff Atwood’s latest post (at the time of writing this) talks about mixing HTML markup and server-side code, àla <table> < ?php foreach($foo as $bar): ?> <tr> <td>< ?php echo $bar; ?></td> </tr> < ?php endforeach; ?> </table><table> < ?php foreach($foo as $bar): ?> <tr> <td>< ?php echo $bar; ?></td> </tr> < ?php endforeach; ?> </table> He also throws in …

Is Smarty really obsolete?

Tags:

There was a short discussion on Zend Framework general mailing list about Smarty being obsolete. I decided to take my opinion here, since the discussion was getting quite off-topic… Arguments against Smarty presented were mainly the facts that it is PHP4 and its no longer necessary in “modern” web development. Note: This post was written in 2008.. Although the points …

How to make back, forward and reload work in Ajax-based apps

Tags:

With Ajax apps getting more and more popular, there’s often the question of the browsers own controls working or not in the app in question. If you hit reload, you might end up back on the start page of the application, if you hit back.. who knows. I think this is especially an issue in applications, where you would work …

Automating creation and caching of image thumbnails

Tags:

The other day I needed to create some thumbnail images. You know, the usual stuff: Admin uploads image, needs it resized to a smaller one for preview or such… I thought, why bother with writing code manually in the admin to create the thumbnail? I mean, the requirements for its size might change, the path to thumbnails might change… The …

JavaScript Canvas charting/timeline example

Tags:

I was on holiday last week and haven’t been really able to think of anything really really interesting to write, so here’s something I made a while back: A Canvas-element powered chart/graph/timeline thing of my programming language skills, which I made as an excercise for making chart-type stuff with canvas. I think the canvas element is starting to get quite …

Simple Photoshop-style layers using JavaScript

Tags:

Today I wrote a small JavaScript class to display images layered on top of each other, in a similar manner as layers are shown in editors like Photoshop. I wanted to show my Dwarf Fortress to someone, but I didn’t just want to stack screenshots below each other like you’d usually do. Since dwarf forts can span multiple depth levels, …

Dependency Injection, or how to make simple concepts sound difficult

Tags:

You may have heard of Dependency Injection. It’s essentially a way to remove implementation dependencies from classes, or “the process of supplying an external dependency to a software component. It is a specific form of inversion of control where the concern being inverted is the process of obtaining the needed dependency.” as Wikipedia puts it. Sounds complex? Yep. Is it …