Prestashop - 1.4 Guide de l'utilisateur Page 33

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 36
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 32
7. $a = 17 + 23; // A comment inside my exemple function
8. Outside funcions and methods, only the "/" and "/" comment tags
are allowed
9.
10. /* This method is required for compatibility issues */
11. public function foo()
12. {
13. // Some code explanation right here
14. [...]
15. }
16. PHP Doc Element comment is required before the method
declarations
17.
18. /**
19. * Return field value if possible (both classical and multilingual
fields)
20. *
21. * Case 1 : Return value if present in $_POST / $_GET
22. * Case 2 : Return object value
23. *
24. * @param object $obj Object
25. * @param string $key Field name
26. * @param integer $id_lang Language id (optional)
27. * @return string
28. */
29. protected function getFieldValue($obj, $key, $id_lang = NULL)
For more informations
For more informations about the PHP Doc norm:
http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.pkg.html
Return values
1. Return statement does not need brackets except when it deals with
a composed
expression
2.
3. return $result;
4. return ($a + $b);
5. return (a() - b());
6. return true;
7. Break a function
8.
9. return;
Call
Function call preceded by a "@" is forbidden but beware with function /
method call with login / password or path argmuments.
myfunction()
// In the following exemple we put a @ for security reasons
@mysql_connect([...]);
Vue de la page 32
1 2 ... 28 29 30 31 32 33 34 35 36

Commentaires sur ces manuels

Pas de commentaire