Vežbe - XII nedelja PHP Doc

Similar documents
PREDMET. Osnove Java Programiranja. Čas JAVADOC

Osnove programskog jezika C# Čas 5. Delegati, događaji i interfejsi

Osnove programskog jezika C# Čas 4. Nasledjivanje 2. deo

VB komande. Programiranje 1

Variable Neighborhood Descent - VND (Metoda promenljivog spusta)

Documenting Lucene.Net

UNIVERZITET U BEOGRADU ELEKTROTEHNIČKI FAKULTET

Svi Java tipovi imaju ekvivalentan tip u jeziku Scala Većina Scala koda se direktno preslikava u odgovarajući Java konstrukt

Računarske osnove Interneta (SI3ROI, IR4ROI)

Uvod u programiranje - vežbe. Kontrola toka izvršavanja programa

Događaj koji se javlja u toku izvršenja programa i kvari normalno izvršenje. Kada se desi izuzetak, sistem pokušava da pronađe način da ga obradi.

Mašinska vizija. Dr Nenad Jovičić tnt.etf.rs/~mv

PHP? PHP (recursive acronym "PHP: Hypertext Preprocessor") Open Source general-purpose scripting language Web development

VHDLPrimeri Poglavlje5.doc

CSS CSS. selector { property: value; } 3/20/2018. CSS: Cascading Style Sheets

pojedinačnom elementu niza se pristupa imeniza[indeks] indeks od 0 do n-1

Documenting Java Code. Javadoc: The Tool and the Legend

Izrada VI laboratorijske vježbe

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

Javadoc. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 7

Tema 8: Koncepti i teorije relevantne za donošenje odluka (VEŽBE)

CSC 121 Computers and Scientific Thinking

HTML: Parsing Library

Chapter Two Bonus Lesson: JavaDoc

Laboratory. of Java and. specifically. On the line the method. does, e.g.: /** Obtains. of the die.

Title: Sep 12 10:58 AM (1 of 38)

DEV2QA PDT 1.1. Feature Name : Code Completion Module name : PHPCompletionEngine

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science

A Balanced Introduction to Computer Science, 3/E

Auto-Generating Documentation & Source Code

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

Documenting Advanced Programming Techniques

Create web pages in HTML with a text editor, following the rules of XHTML syntax and using appropriate HTML tags Create a web page that includes

Programiranje Internet aplikacija

Zend Studio has the reputation of being one of the most mature and powerful

Write for your audience

Exceptions. Author: Boaz Kantor The Interdisciplinary Center, Herzliya Introduction to Computer Science Winter Semester

Javadoc short tutorial

HTML: Parsing Library

Announcements. Paper due this Wednesday

User Interface Programming OOP/Java Primer. Step 3 - documentation

Selected Sections of Applied Informatics

PRINCIPI SOFTVERSKOG INŽENJERSTVA TIM NAZIV_TIMA

Birkbeck (University of London)

Windows Server 2012, VDI Licenciranje najprodavanijeg servera, što je novo, VDI licenciranje. Office 2013 / Office 365

INTRODUCTION TO HTML5! HTML5 Page Structure!

Programske paradigme Funkcionalna paradigma

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

PHP wrong (old) way. <?php. //connect to db //get items //show in html //get other items //show in html //close connection?> <h1>some html here</h1>

Comp151 Lab Documentation using Doxygen

Zend Studio TM. User Guide: Zend Studio 5.2. By Zend Technologies, Inc. w w w. z e n d. c o m

JAVA PROGRAMMING LAB. ABSTRACT EXTRA LAB, In this Lab you will learn working with recursion, JRX, Java documentations

var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin ListBox1.Items.LoadFromFile('d:\brojevi.

CHAPTER 1: GETTING STARTED WITH HTML CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

Aspektno programiranje u Javi. AOP + AspectJ

CSC Web Programming. Introduction to JavaScript

UNIT II Dynamic HTML and web designing

QueueBlock, ReversalADT, LinkedList,CustomerAccount, not MaintainCustomerData

Java Server Pages. 31-Dec-12

Coding Standards for Java

Lyna Framework Documentation

Beginning Web Programming with HTML, XHTML, and CSS. Second Edition. Jon Duckett

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM

Certified HTML5 Developer VS-1029

public static boolean isoutside(int min, int max, int value)

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Structuring Documents for the Web 1

PHP & My SQL Duration-4-6 Months

Tutorial 2 - HTML basics

3. NetBeans IDE 6.0. Java. Fall 2009 Instructor: Dr. Masoud Yaghini

Dependency Injection Container Documentation

Welcome to CSSE 220. We are excited that you are here:

namespace spojneice { public partial class Form1 : Form { public Form1() { InitializeComponent(); }

Internet publishing HTML (XHTML) language. Petr Zámostný room: A-72a phone.:

INTERNATIONAL INDIAN SCHOOL, RIYADH XI XII BOYS SECTION INFORMATICS PRACTICES WORKSHEET 15 TH CHAPTER DATABASE TRANSACTION IMPORTANT QUESTION

Zend Studio 5.5 for i5 /OS

Week 1 - Overview of HTML and Introduction to JavaScript

Defensive Programming

Adam Huječek NSWI126

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

c122sep814.notebook September 08, 2014 All assignments should be sent to Backup please send a cc to this address

32-Bit-Digital Signal Controller TMS320F2833x. Texas Instruments Incorporated

Utilities (Part 3) Implementing static features

Basic HTML Handout & Exercise Web Technology

Bok, Jong Soon

What You Will Learn Today

Creating Web Pages. Getting Started

This document provides a concise, introductory lesson in HTML formatting.

Deo J. VBA Objects, Properties, Methods, Events,... PROJEKTOVANJE KLASNIH MODULA... Objekti Svojstva. Metode. Dogadjaji KLASE.

LAT-TD-xxxxx-xx May 21, 2002

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

HTML5. Juha Söderqvist

RDF, RDFS i JSON-LD. NIKOLA MILIKIĆ URL: nikola.milikic.info

HTML Markup for Accessibility You Never Knew About

User Guide Zend Studio for Eclipse V6.1

Prirodno-matematički fakultet u Nišu Departman za fiziku. dr Dejan S. Aleksić Programiranje u fizici

Lecture Notes CPSC 224 (Spring 2012) Today... Java basics. S. Bowers 1 of 8

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong:

On a blog, code can mean many things. It can refer to the complicated

Transcription:

Vežbe - XII nedelja PHP Doc Dražen Drašković, asistent Elektrotehnički fakultet Univerziteta u Beogradu

Verzija alata JavaDoc za programski jezik PHP Standard za komentarisanje PHP koda Omogućava generisanje spoljnog dokumenta Služi za bolje tumačenje tipova promenljivih i drugih nedorečenosti, objašnjenje lošije kucanog koda, uklanjanje grešaka,... Postoji u različitim okruženjima - NetBeans, Aptana studio, PHPEdit, Zend Studio,... Veb interfejs je moguć uz Apache ili neki veb server (i PHP treba da radi na istom serveru)

DocBlock je proširenje C++ Blok počinje sa /** i ima * na početku svake linije Blok prethodi elementu koji se dokumentuje Svaka linija u okviru bloka koja ne počinje sa * će biti ignorisana Završava se sa **/ @ je specijalni način za početak DocBlock linije

Inicijalizacija PHPDoc define("phpdoc_include_dir", "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/PHPDoc/"); define("linebreak", "\r\n"); include("phpdoc/prepend.php"); $doc = new Phpdoc; $doc->setapplication("joe's Resume"); $doc->setsourcedirectory(phpdoc_include_dir); $doc->settarget(phpdoc_include_dir."apidoc/resume/"); $doc- >settemplatedirectory(phpdoc_include_dir."renderer/html/templ ates/"); $doc->setsourcefilesuffix( array ("php", "inc") ); Obrada dokumenta $doc->parse(); $doc->render();

Primer 1 /** * This is a DocBlock comment */ function izracunajpoene() { }

Primer 2 /** * DocBlock za funkciju izracunajocenu? * * Ne, ovo je komentar za konstantu ocena! */ define( ocena',6); function izracunajocenu($param = ocena) { }

Primer 3 /** * Author: Drazen * A sample function docblock * @global string document the fact that this function uses $_myvar * @staticvar integer $staticvar this is actually what is returned * @param string $param1 name to declare * @param string $param2 value of the name * @return integer */ function firstfunc($param1, $param2 = 'optional') { static $staticvar = 7; global $_myvar; return $staticvar; }

define() izrazi, funkcije, klase, klasne metode i varijable, include() izrazi, globalne varijable Blok sadrži tri osnovna segmenta u ovom redosledu: Kratak opis Duži opis Tag

Primer 3 /** * return the date of Easter * * Using the formula from "Formulas that are way too complicated for anyone to * ever understand except for me" by Irwin Nerdy, this function calculates the * date of Easter given a date in the Ancient Mayan Calendar, if you can also * guess the birthday of the author. */

Možemo koristiti: <b> -- emphasize/bold text <code> -- Use this to surround php code, some converters will highlight it <br> -- hard line break, may be ignored by some converters <i> -- italicize/mark as important <kbd> -- denote keyboard input/screen display <li> -- list item <ol> -- ordered list <p> -- If used to enclose all paragraphs, otherwise it will be considered text <pre> -- Preserve line breaks and spacing, and assume all tags are text (like XML's CDATA) <samp> -- denote sample or examples (non-php) <ul> -- unordered list <var> -- denote a variable name

Počinju sa: /**#@+ * */ Završavaju se sa: /**#@-*/

Tag Usage Description @abstract Documents an abstract class, class variable or method. @access Documents access control for an element. @access public, private or private indicates that documentation of element protected be prevented. @author author name <author@email> Documents the author of the current element. @copyright name date Documents copyright information. @deprecated version Documents a method as deprecated. @deprec Same as @deprecated @example /path/to/example Documents the location of an external saved example file. @exception Documents an exception thrown by a method also see @throws. @global type $globalvarname Documents a global variable or its use in a function or method. @ignore @internal Prevents the documentation of an element Private information for advanced developers

@link @name @magic URL global variable name Specifies an alias for a variable. For example, $GLOBALS['myvariable'] becomes $myvariable phpdoc.de compatibility "phpdocumentor tags". @package name of a package Documents a group of related classes and functions. @param @return @see type [$varname] description type description element This tag should not be used for constructors or methods defined with a void return type. [citation needed] Documents an association to any element (global variable, include, page, class, function, define, method, variable). @since version Documents when a method was added to a class. @static Documents a static class or method @staticvar type Documents a static variable's use in a function or class @subpackage @throws Documents an exception thrown by a method. @todo Documents things that need to be done to the code at a later date. @var Type A data type for a class variable @version Provides the version number of a class or method.

PHPDoc omogućava programerima da smanje nepotrebno kucanje koristeći DocBlock templates

class Bob { // beginning of docblock template area /**#@+ * @access private * @var string */ var $_var1 = 'hello'; var $_var2 = 'my'; /** * Two words */ var $_var8 = 'like strings'; /**#@-*/ var $publicvar = 'Lookee me!'; }

class Bob { // beginning of docblock template area /** * @access private * @var string */ var $_var1 = 'hello'; /** * @access private * @var string */ var $_var2 = 'my'; /** * @access private * @var string */ /** * Two words */ var $_var8 = 'like strings'; var $publicvar = 'Lookee me!'; }

Dokumentacija neophodna u kodiranju! PHPDoc dobar za dokumentovanje klasa i funkcija Stranice nešto sporije PHPDoc dokumentacija može se generisati u svakom trenutku PHPDoc vrlo jednostavan za korišćenje