Screen is blank when I add call to another method in different model? |
[eluser]gypmaster[/eluser]
Hi, Noob here ... just starting out (again) with CI and I'm messing around with it. I've got my db set up and have started writing controllers, models and views. The index() method in my controller generates a list of Properties, next to each Property is a link to view to view the Property details, the link is handled by the view() method. Got a problem though. Here's my controller: Code: <?php Here are the models: Code: <?php Code: $data['rooms'] = $this->mroom->get_all($propid); Anyone know what I'm doing wrong? Thanks, Mark.
[eluser]painkiller[/eluser]
How do you handle $rooms in your view? You use result_array() in all your models and result() in the one making you problems, result would return you the data wrapped around an stdObject ? Does the view load?
[eluser]TheFuzzy0ne[/eluser]
There are two causes that I know of. 1) You have enabled compression, and you have a whitespace somewhere being output prematurely. 2) Error reporting is disabled, or set too low. If it's the latter, try putting this at the top of your index.php file: Code: ini_set('display_errors','1'); You should find all errors are now displayed.
[eluser]gypmaster[/eluser]
When I click on the link to which calls the view method the following appears in my browser address bar: http://localhost/codeIgniter/index.php/property/view/7 But the screen is completely blank. btw, I've changed the model to use result_array() but it made no difference. here's the view Code: <?php
[eluser]gypmaster[/eluser]
TheFuzzyOne, thanks. setting the error reporting showed me that I'd mistyped the get_where in the mroom model. I've corrected the error and now it works as it should. thanks again.
[eluser]TheFuzzy0ne[/eluser]
Glad to be of service. Just don't forget to disable error reporting on your production server. ![]() |
Welcome Guest, Not a member yet? Register Sign In |