Understanding the theme() function on Drupal
One of the most complicated things to understand when templating or developing modules for drupal is the theme() function. But when you know how to deal with it is really useful even when there’s no way to know how many we have available.
The way to use it fairly simple, let’s see how the Garland theme builds the primary links:
print theme('links', $primary_links, array('class' => 'links primary-links'));
The first argument is the actual hook we are calling, the second and third are the the arguments we are passing to that functions.
So basically the theme function will output plain HTML and it’s actually way cleaner than defining a function or coding a lot of php on our template.
Read the rest of this entry »
Since a while I’ve been talking about this OS and how I liked the way it can do multitasking. And now the more I use it the more I like it, so I decided to start building an application for it and give the OS a complete try. I bought the first Android device, the G1 from HTC and even when it’s not the best phone out there, it comes with Android OS so that’s enough for me.