Some **OK** code in my controller beaks CodeIgniter: output goes totally blank. |
[eluser]Fabdrol[/eluser]
Besides, I'm sorry for the half-post earlier. My internet connection got mixed up in the train so the forum posted half my code ;-) I've completely scanned my code and can't find any more typos... but I'm still getting blank screens. Is it a CI issue, or is it invoked by something in my code? I'm very confused... thanks! Code: <?php if(!defined('BASEPATH')) exit('No direct script access allowed'); I'm not even getting the 'hello world' thing..
[eluser]Jelmer[/eluser]
Sorry, don't have the time to look into the script to find the problem. But in regard to the missing error_reporting: it's set to E_ERROR in the main index.php file at the top. Look into my starting with CI article (in my sig) for a suggestion to get both PHP & Database errors easily switched on (for development use) and off (for public use).
[eluser]Fabdrol[/eluser]
Np, but my error reporting levels are set accordingly. I wouldn't post the problem here if i'd get an error message of some kind, probably.
[eluser]Jelmer[/eluser]
I understood you did, but as I read your post you set it in your php.ini - which is overruled in the first part of your main index.php file that says: Code: <?php Which you might change to: (to see if that makes it show errors) Code: <?php
[eluser]intractve[/eluser]
SOmeone correct me if I am wrong, but I do not believe you can use function variables in the controller, like function serve($type,$query) { ... } That is only for Libraries / Models / Internal functions in controller. Controller functions are invoked via URL (except internal functions) and not sure how you are sending the variables to your function I would use Code: function serve()
[eluser]Fabdrol[/eluser]
[quote author="intractve" date="1261089579"]SOmeone correct me if I am wrong, but I do not believe you can use function variables in the controller, like function serve($type,$query) { ... } That is only for Libraries / Models / Internal functions in controller. Controller functions are invoked via URL (except internal functions) and not sure how you are sending the variables to your function I would use Code: function serve() you sure can. It works like this: Code: function serve($a, $b) { access the variables like this (via the url) Code: site-name.com/index.php/proxy/serve/var_a/var_b see also: http://ellislab.com/codeigniter/user-gui.../urls.html
[eluser]intractve[/eluser]
By using URI-Routing? coz the link you gave didn't have a specific info for this. Just asking to know coz this will be very useful in my projects.
[eluser]Fabdrol[/eluser]
[quote author="intractve" date="1261091241"]By using URI-Routing? coz the link you gave didn't have a specific info for this. Just asking to know coz this will be very useful in my projects.[/quote] well, CI uri segments works like this: base_url() / Controller name / Method name / Parameter 1 / Paremter 2 / etc...
[eluser]BrianDHall[/eluser]
Even if you don't use it much, it's nice to have an IDE with syntax verification like netbeans to use in cases like this. Took me just about 30 seconds to pop it open, paste in your code, and have it reveal the problem. Lines 34-37: Code: $out = array( The annoyance of using multiple languages at once - you defined your array in javascript style A simple correction removes the syntax errors, so hopefully this will solve the issue: Code: $out = array( One downside to CI is this blank-screen problem, where in pure PHP it would always output _something_. My solution is using step-through debugging - you just advance one line at a time until it suddenly halts execution, and you know that last line was where something broke php. |
Welcome Guest, Not a member yet? Register Sign In |