Answer the question
In order to leave comments, you need to log in
Why doesn't the file connected via include see the variables?
PHP Version 7.2.19-0ubuntu0.18.04.2
Linux ubuntu-s-1vcpu-1gb-fra1-01 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64
Site on Codeigniter 3 After the transfer, it stopped displaying data. That is, the template is displayed, but there is no information from the database. I got to the Loader.php file, which contains the following lines:
extract($this->_ci_cached_vars); - here it is clear - Imports variables from an array. Checked up - variables are imported. For example print_r($slider); prints the required information.
ob_start();
include($_ci_path); - we include a file that uses imported variables, for example:
<? if (isset($slider) && sizeof($slider)) { print_r($slider); }?>
Nothing is printed as a result. Why does the included code not see the variables?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question