steva
asked on
Troubleshooting CodeIgniter
I'm trying to understand some CodeIgniter code that has landed my lap and I'm a bit frustrated by not being able to echo out variables for troubleshooting. That is, echoes in the controller classes don't seem to work, so I can't see what variables are being handled. Admittedly I'm new to CodeIgniter and haven't gone though the entire manual yet (though I did look for a troubleshooting section and didn't find one). I ordered a couple of Amazon books tonight, but they're no help until they get here.
I wonder if someone out there might have some CodeIgniter experience and be able to say a few words about how you troubleshoot CodeIgniter projects. The framework seems well thought out so I have to believe there's some help built in that I just don't know about.
Thanks for any info.
Steve
I wonder if someone out there might have some CodeIgniter experience and be able to say a few words about how you troubleshoot CodeIgniter projects. The framework seems well thought out so I have to believe there's some help built in that I just don't know about.
Thanks for any info.
Steve
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Marqus, Thanks. That helps.
I appreciate your offering to look at some code.
Here's the beginning of an editor.php file that creates an editor class, that's giving me some trouble:
Also, the line
if (is_allowed() === FALSE)
is a bit puzzling. is_allowed() doesn't seem to be a PHP construct and it doesn't show up in the online index of the CodeIgniter books I ordered from Amazon.
Thanks for your help.
Steve
I appreciate your offering to look at some code.
Here's the beginning of an editor.php file that creates an editor class, that's giving me some trouble:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Editor extends CI_Controller {
/* Constructor */
public function __construct()
{
parent::__construct();
$this->load->helper(array('fgimages','language'));
if (is_allowed() === FALSE)
{
exit;
}
$this->config->load('uploader_settings', TRUE);
}
I see from the online manual that the helper "array" seems to use the first parameter as key into the array named by the second parameter and return the value there. But there's no "language" array that I can find in the code. And where is the value found transferred to? It gets "loaded" but into what?Also, the line
if (is_allowed() === FALSE)
is a bit puzzling. is_allowed() doesn't seem to be a PHP construct and it doesn't show up in the online index of the CodeIgniter books I ordered from Amazon.
Thanks for your help.
Steve
ASKER
Eddie,
Thanks for that tip. I keep expecting, though, to find a whole bag of troubleshooting tools built into CodeIgniter. I guess not.
Thanks for that tip. I keep expecting, though, to find a whole bag of troubleshooting tools built into CodeIgniter. I guess not.
Hi.
$this->load->helper(array( 'fgimages' ,'language '));
This laine loads two helpers: fgimages and language. The second one resides in system/helpers and it's a standard CI helper. The first one seems to be a custom helper and you could find it, if it is not in system/helpers folder, within application/helpers folder.
I'm sure is_allowed is a function of fgimages helper which checks if the image type is allowed against an array mayby in the config file or in the fgimages_helper itself.
If you dont find fgimages helper in the folders I mentioned above, look around through your directory tree.
Cheers
$this->load->helper(array(
This laine loads two helpers: fgimages and language. The second one resides in system/helpers and it's a standard CI helper. The first one seems to be a custom helper and you could find it, if it is not in system/helpers folder, within application/helpers folder.
I'm sure is_allowed is a function of fgimages helper which checks if the image type is allowed against an array mayby in the config file or in the fgimages_helper itself.
If you dont find fgimages helper in the folders I mentioned above, look around through your directory tree.
Cheers
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Marqus,
Yes, I found "language_helper.php" in the system/helpers directory and "fbimages_helper.php" was in application/helpers. " is_allowed.php" was a file in the project folder, at the same level as ci, which just returns true, for now.
One of the books I ordered ("CodeIgniter for Rapic PHP Application Development") came today, so I'll jump off into that now.
Thanks for all your help.
Steve
Yes, I found "language_helper.php" in the system/helpers directory and "fbimages_helper.php" was in application/helpers. " is_allowed.php" was a file in the project folder, at the same level as ci, which just returns true, for now.
One of the books I ordered ("CodeIgniter for Rapic PHP Application Development") came today, so I'll jump off into that now.
Thanks for all your help.
Steve
Thanks for points and best of luck with your project.
if in your controller you have something like
Open in new window
You can replace the standard view with a test view where you only print out $data to check if they are correct:Open in new window
If you post hewree some code we can help better.
Cheers