Programming

How to programmatically create a form tree in Drupal

When you work on forms in Drupal where you want to have the same form array elements used multiple times in a form you can use the concept of for form tree. For example if you are working on a purchase order form where you want to have multiple rows of product information like say product name, product code, quantity, price etc, for each product added to the form. This can easily be done using the form tree as follows.

Searching file contents using find for multiple file extensions in Linux

If you use GNU/Linux as your development environment then you inevitably has to use the find command at some point of time. A very common need while developing web applications is to search for the occurrences of a given string in files, very often with different extensions, under a given project. The command 'find' is a very powerful search utility that can be wielded according to our convenience and can be used in this scenario.

Syndicate content