Jump to content

PHP Includes


iwato

Recommended Posts

BACKGROUND: Recently I learned how to create a dynamic table using a file include, an echo statement filled with CSS code, and a function with an id parameter. What is missing is a way to identify the included file without having it appear in the browser window. For the moment all I have is a nearly barren file with a .php extension.QUESTION: What is standard protocol for identifying and describing included files?

<?php echo( '<style type="text/css"> 	div.table {		margin-left:auto;		margin-righ:auto;		width:80%;	} 	table#standard th {		vertical-align:top;		text-align:right;		padding-right:2em;	}</style>');	function create_Table($array, $id = '') {		echo '<div class=\'table\'><table id=\'' . $id . '\'>';		foreach ($array as $key => $value) {			if (is_string($value)) {				echo '<tr><th>' . $key . '</th><td>' . $value . '</td></tr>';			} else {				list($param_key, $param_value) = each($value);				echo '<tr><th>' . $key . '</th><td>' . $param_key . ': ' . $param_value . '</td></tr>';				while (list($param_key, $param_value) = each($value)) {				echo '<tr><th></th><td>' . $param_key . ': ' . $param_value . '</td></tr>';										}			}		}		echo '</table></div>';	}?>

Roddy

Link to comment
Share on other sites

Thank you for responding.

PHP doesn't offer any metadata about the file other than what the OS supports.
I am not seeking to gather information about a file; rather I am interested in the proper way to supply information to a file -- namely, the sort of things that normally includes in metadata such as document title, author, description, etc.Is this simply entered through PHP comment? If so, is there a standard approach to doing so? If not, what you suggest and why?Roddy
Link to comment
Share on other sites

Regardless of the language, information like that is given in comments. There are several tools that will automatically generate documentation based on comments, so if you want to follow any particular convention instead of whatever makes the most sense to you, something like PHPDoc would give examples for adding comments to automatically produce documentation:http://manual.phpdoc.org/HTMLSmartyConvert...kstart.pkg.html

Link to comment
Share on other sites

Regardless of the language, information like that is given in comments. There are several tools that will automatically generate documentation based on comments, so if you want to follow any particular convention instead of whatever makes the most sense to you, something like PHPDoc would give examples for adding comments to automatically produce documentation:http://manual.phpdoc.org/HTMLSmartyConvert...kstart.pkg.html
Thanks!For the moment I happy to have learned what a DocBlock is.It should be enough to get me started in the right direction.Roddy
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...