30,997
edits
mNo edit summary Tag: 2017 source edit |
m (→Skeleton code) Tag: 2017 source edit |
||
| Line 435: | Line 435: | ||
Use it as an example. | Use it as an example. | ||
Note that the skeletons are also used by the PHP Code generator ([[Module ModuleBuilder]]), which is described in the development chapter of Dolibarr modules, to speed up your development. | Note that the skeletons are also used by the PHP Code generator ([[Module ModuleBuilder]]), which is described in the development chapter of Dolibarr modules, to speed up your development. | ||
== Global variables== | |||
There is some information or objects that is common and fixed for all the execution of a PHP page and need to be used nearly everywhere in the code. To avoid to propagate everywhere this | |||
information or objects, they are stored into global variables that you can access everywhere. This global variables are initialized at the begin of each PHP call (into the master.inc.php or master.inc.php or in top of the page). For objects, they are instantiated only once. The list of available global variables is defined here: | |||
{{Template:TemplateGlobalVariables}} | |||
* $conf is the object that contains the configuration (saved into database) | |||
* $user is the object of the current user | |||
* $mysoc is the object with all information about the current company | |||
* $db is the database handler of the current database connexion | |||
* $hookmanager is a factory class to manage hooks | |||
* $extrafields is a factory class to manage extrafields | |||
==Dates and Timezones== | ==Dates and Timezones== | ||