Module development: Difference between revisions

Jump to navigation Jump to search
Line 56: Line 56:
''Example :''
''Example :''
<source lang="php">
<source lang="php">
require_once 'class/myclass.php';
if (! class_exists('MyClass')) {
// Or
    require 'class/myclass.php';
require_once '../class/myclass.php';
}
// Ou bien encore
if (! class_exists('MyClass')) {
    require '../class/myclass.php';
}
</source>
 
* The inclusion of a class dedicated to the module, without knowing from where the file will be called, is done using a function Dolibarr;
''Example :''
<source lang="php">
dol_include_once('/mymodule/class/myclass.class.php', 'MyClass');
</source>
</source>


17

edits

Navigation menu