HOW TO include and evaluate files?

Discuss everything related to ApPHP Durecty CMF. All versions. Any questions related to the Directy CMF developing or using should be posted to this forum.

Moderators: alexandrleonenko, alexmst

administrator
Site Admin
Site Admin
Posts: 6169
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO include and evaluate files?

Postby administrator » May 13th, '16, 15:36

If you need to include files, for example libraries into yuor code, you may use a standard PHP statement.
Another way is to use CLoader helper (added from Framework v.0.7.7)

Examples of usage:

Code: Select all

// Looks only in directory "library/"
CLoader::load()->library('PaymentGateway.php', 'ipgw/providers/');

or
// includes file

Code: Select all

CLoader::load()->file($classFile, 'ipgw/providers/');

// returns file content

Code: Select all

CLoader::load()->file($classFile, 'ipgw/providers/', true);

or
// for config files

Code: Select all

CLoader::load()->config('news', 'main');

Return to “ApPHP Directy CMF {developers/users}”