PradoSoft

Menulis Dokumentasi

From PRADO Wiki

Seluruh kode yang dirilis secara resmi harus disertai dengan dokumentasi API lengkap, format yang mengikuti PHPDocumentor.

Sebagai contoh, kami menjelaskan bagaimana untuk menulis dokumentasi untuk kelas TControl, yang ditempatkan dalam file TControl.php. Seperti kita lihat dalam kode berikut, dokumentasi sebagian besar termasuk:

  • blok dokumen untuk file kode,
  • blok dokumen untuk setiap kelas,
  • dan blok dokumen untuk setiap metode kelas.

Setiap blok dokumen dapat dimulai dengan satu baris penjelasan singkat atas sasatan dokumentasi (file, kelas atau metode), diikuti dengan penjelasan lebih rinci dalam satu atau beberapa paragraf.

Blok dokumentasi untuk metode kelas juga berisi informasi mengenai parameter, nilai balik dan eksepsi yang memungkinkan.

 
<?php
/**
 * ...brief explanation of this file in one line (required).
 *
 * ...detailed explanation of the file (optional).
 *
 * @author Qiang Xue <qiang.xue@gmail.com>     (author information)
 * @link http://www.pradosoft.com/             (link to pradosoft.com)
 * @copyright Copyright &copy; 2005 PradoSoft  (copyright info)
 * @license http://www.pradosoft.com/license/  (license info)
 * @version $Revision: $  $Date: $             (version info)
 * @package System.Web.UI                      (package info)
 */
 
/**
 * ...brief explanation of the class in one line(required).
 *
 * ...detailed explanation of the class (required).
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @version $Revision: $  $Date: $
 * @package System.Web.UI
 * @since 3.0
 */
class TControl extends TApplicationComponent implements IRenderable, IBindable
{
	......
 
	/**
	 * ...brief explanation of the method in one line (optional).
	 * ...detailed explanation of the method (optional).
	 * @param string ID of the control to be looked up
	 * @return TControl|null the control found, null if not found
	 * @throws TInvalidDataValueException ...
	 */
	public function findControl($id)
	{
		......
	}
 
	......      
}
?>
Personal tools
Your user name:

Your password:

MediaWiki