Problem with integration with Tiny File Manager |
Hello,
I have a problem integrating Tiny File Manager with CodeIgniter 4. I added the code from above like a view in MVC and everything worked (and adding it gave me a number of integration options with the remaining code). Everything worked fine with CodeIgniter 3, but the server on which the website is hosted requires the use of CodeIgniter 4 for security purposes. For me, it's not a problem, I've already done everything, but I can't integrate Tiny File Manager. Neither the old version works nor the new one. In the new one I get an error: Code: Tiny File Manager It is related to the fact that there are variables in VIEW that should be global and after adding print_r() you can see its value, but immediately after using global $config it is not known why it is cleared.
What is the code from above?
What is global $config? How did you set?
I have the current code from https://github.com/prasathmani/tinyfilemanager
The previous version worked for me in this way: I pasted everything from the tinyfilemanager.php file into the view that was called by the controller and everything worked properly. Now after changing to CodeIgniter 4, unfortunately it doesn't work and the error I get is given above ![]() I will add that adding information from https://tinyfilemanager.github.io/docs/#Embedding to the controller unfortunately has no effect
It seems you did something wrong with CI4.
Can you show the code?
Menadzerplikow_c.php
PHP Code: <?php https://github.com/prasathmani/tinyfilem...anager.php
In a view file, variables are not global.
In a controller or model class, variables are not global.
It is bad practice to use global variables, so there is no place to use global variables in CI4. But if you want to use global variables, you could use because that is a PHP language feature. You need to make it global explicitly. PHP Code: global $CONFIG; (10-06-2023, 01:39 AM)kenjis Wrote: In a controller or model class, variables are not global. There is a global in the above script (please see the link) and unfortunately it does not work after pasting in VIEW. So what should I do to make it work? Please see this script and give me a hint. |
Welcome Guest, Not a member yet? Register Sign In |