New Jersey’s source for Open Source Consulting since 1998

symfony and Open Flash Charts

I’ve been playing with symfony for a project I’m working on called Intelligence Exchange. So far, it’s been pretty cool, even if the learning curve is a bit steep.

As a sub-project, I want to write a cool-looking dashboard to monitor database activity. After looking around a while, I stumbled upon OpenFlashCharts. It looks good, it’s free and, best of all, it’s Free. I’m really looking forward to digging through its code RSN since I’ve been wanting to learn Flash. There’s even a symfony plugin for OpenFlashCharts! What more could one ask for?

Better frakkin’ documentation, that’s what! On the plugin download page, the example they give doesn’t work (on a properly configured system anyway).

If you look at the example given, the code snippet at the bottom of the page for the view template is this:


<? use_helper("OpenFlashChart"); ?>
...
...
...
<?= open_flash_chart( 300, 300, 'example/chartData'); ?>

Well, on my Macbook running php5, that <?= thingie does nothing. Why? Because “short open tags” (SOT), as they are known, are A Bad Thing and no one should be using them in this day and age. Hell, the general consensus back in the year 2000 was not to use them! Why they’re still being allowed eight years later is another bitch I’ve got with the designers of PHP!

The above isn’t quite true. Even with the short open tags, the code was *still being executed*. My system is configured NOT to use the SOT. To me, <sarcasm>and I may be a bit naive here </sarcasm>, if something is configured not to work, I expect it not to work! but I was able to sprinkle echo commands throughout the Helper code and see the results! IOW, the code was still being executed! WTF?!

To make the above example work, change the above line to read like this:


<?php echo open_flash_chart( 300, 300, 'example/chartData'); ?>

now the example pie chart shows up!

Technorati Tags: , , , , ,

Tags:      

 

Leave a Reply


Linux New Jersey powered by WordPress Wordpress Template Design was Done In Style.
Entries (RSS) and Comments (RSS).