3
I am trying to make an integration between a system developed in Codeigniter(CI) with Moodle and I need to include in the CI a file from the Moodle library, to recover some data.
However I am not able to do the inclusion of the arquvio in the IC, to work with it within the controllers. File inclusion works perfectly in CI index.php, but I can’t use its variables inside the controllers
Remembering that my IC is inside a folder of Moodle, ie it would be a module of this system.
Someone has the knowledge to achieve this integration?
The structure is like this: I want to include inside the CI the parameter.php file and use its variables in the controllers
File parameters.php
<?php
unset($CFG);
global $CFG;
$CFG = new stdClass();
require_once(dirname(__FILE__) . '/lib/setup.php');
lib/setup.php can be viewed here:
Did you ask her where? Have you tried looking at load.php, to load the model automatically?
– Sr. André Baill
Not a model, Moodle is a CMS
– tkmtts
What is the contents of the file?
– Guilherme Nascimento
It is a variable that contains an object
– tkmtts
Put the content, there are countless ways to create the variables, can be in array, can be in anything. Session only fails with the included file or fails without?
– Guilherme Nascimento
Dude, this file is like an autoload of Moodle, it imports several classes into this file, and these files have several other uploads. Which makes it impossible to put all the files here, but basically the.php parameter is what I have now put in Description.
– tkmtts