Monday, February 4, 2008

Writing a function

Hi,

I have created a function to display the list of all the projects in the system.
This is the getAllProjects() function from our system architecture.

Since it belongs to the "Project Browsing" module. I have created a folder called "project browsing" which has a file called functions.php. functions.php will defination for all the functions that belong to this module.

Before we start any new function we can write a short description about the function. Example:
/*#########################################
Author:your name
Date:02/04/2008
Description:This functions displays the list of all the projects on the website.
It is called by all the pages that need list of projects to be displayed.
###########################################*/
function getAllProjects()
{
....
....
....
}
We can copy paste the Description of a function from our excel sheet.

The page that calls this function is viewListOfAllProjects.phphttp://discern.uits.iu.edu:8490/viewListOfAllProjects.php

Please, look at the code and tell me, if you like my coding style. If you don't like it then we can change it to something thats more easy to understand. But, Please do not change the php file.

A common coding style will help our code to be consistent.

I have not commented the code very well, but i guess, it should be easy to understand.

Thank you,

0 comments: