Hey folks!
I have moved my blog to a top level domain now. From now on, you will see my posts at:
Thanks for everyone's support.
a blog from a web addict
Hey folks!
I have moved my blog to a top level domain now. From now on, you will see my posts at:
Google is always very well equipped when it comes to APIs. I found out about their Charts API today and want to let you all know how to use it. Its not very difficult - just like placing an image tag in your HTML document.
3D pie chart
For example, you want to have a 3D pie chart with two segments (one is 30% and the other is 70%). So, this will be the url for that graph: http://chart.apis.google.com/chart?cht=p3&chd=t:70,30&chs=300x100&chl=Segment1|Segment2
And here comes the image output (generated by Google Charts!):
You can find out more about it here: http://code.google.com/apis/chart/
After spending one whole evening, I found out CakePHP has its own XML class for handling xml files. In the meantime, i tried SimplePie (for RSS only, not XML), SimpleXML, and XMLize. But still they werent of any great help compared to cakephp's core XML class.
How to parse it then?
First of all, you need to import the XML class in your controller class using App::import(). Here is the controller class parsing a particular xml file and printing out (like print_r) the returned array.
Controller class:
I have been really very busy this month. Hardly had time to post anything on my blog. So thought I better post a short quick tutorial of a dashed vertical css menu.
Preview (it will look like this at the end)
(Link 1 is hovered in the image)
HTML (the ever popular unordered list!):
This helper will let you create search engine friendly urls without having you to change the controller logic.
Lets assume we have an 'articles' controller (/app/controllers/articles_controller.php) in our website. And the database table looks like this:
id, category_id, title, content, updated, created
The current url structure:
yoursite.com/articles/category/[category-id]/
yoursite.com/articles/view/[article-id]/
So, it means we dont have the 'title' of our articles included in the url. Only ID is present. This helper will let you add the title as well in the url.
Helper class
Someone asked me to show how I created the tabbed navigation thing in my blog (right column). Just to let you know, I am just using an existing template for my blog, but wish to design one myself in future.
In this tutorial, I am going to show you how to create a simple tabbed navigation using jQuery (as you know, its a javascript library).
Requirements
You will require two javascript files for doing this.
jQuery library - Download here
jQuery UI (user interface) tabs - Download here
HTML code
Suppose we have three div elements in our webpage (box-1, box-2, and box-3), and we want them in tabs.
In this tutorial, I am going to show you how to simulate a table-like interface for designing a form using css. Since tables are not involved, we will require the label element for each and every field in our form.
Preview
This is what we will be doing.
here goes the css code: