quarta-feira, 27 de março de 2013

Gerando documentação para funções no Netbeans

Basta colocar este bloco de comentários antes da definição da função:

1:  /**   
2:   * contarDiffHoras  
3:   *  
4:   * conta a diferença em horas entre a data informada e a data do sistema  
5:   * obs: sempre uma data no passado  
6:   *  
7:   * @param string $data a data para comparar no formato d/m/Y H:i  
8:   */  


Fica assim:

1:  /**   
2:   * contarDiffHoras  
3:   *  
4:   * conta a diferença em horas entre a data informada e a data do sistema  
5:   * obs: sempre uma data no passado  
6:   *  
7:   * @param string $data a data para comparar no formato d/m/Y H:i  
8:   */  
9:  function contarDiffHoras($data){  
10:       $data = date_create_from_format('d/m/Y H:i', $data);//data informada  
11:       $now = date_create();//data atual  
12:       $diff = date_diff($now, $data);//calcula a diferença entre as datas  
13:       return ($diff->format('%a') * 24) + $diff->format('%H');//calcula a diferença em horas  
14:  }  

E, no Netbeans, aparece assim:

quinta-feira, 7 de março de 2013

Judgement of Heaven

If you could live your life again
Would you change a thing
Or leave it all the same?
If you had the chance again
Would you change a thing at all?
When you look back at your past
Can you say that you are proud
Of what you've done?
Are there times when you believe
That the right you thought was wrong?