[eluser]Evil Wizard[/eluser]
[quote author="linderox" date="1243919552"]I have working code on a localhost, but on a hosting it doesn't work. My browser show me just blank page without any HTML code. The problem in some relations with model.
If I put code from model to the controller everything shows me in the best way.
Code:
<?php
class Gallery extends Controller {
function Gallery()
{
parent::Controller();
}
function index()
{
$data['title'] = "Rock Battle | Фотогалерея";
$data['items'] = $this->gallery_model->getcategories();
$this->load->view('gallery/index2', $data);
$this->load->view('sidebar');
}
}
?>
Code:
<?php
class Gallery_model extends Model {
function Gallery_model()
{
parent::Model();
}
function getcategories()
{
$query = $this->db->get('photostock_catg');
return $query->result_array();
}
}
here is view/gallery/index2.php
Code:
<hr />
<div id="page">
<? foreach ($items as $row) {
echo '<div class="photocategory"><div class="image"><div class="pic">';
echo '<a href="'.base_url().'gallery/'.$row['alias'].'" src="'.base_url().$row['imgtitle'].'" alt="" width="260" height="173" class="left"></a>' ;
echo '</div></div><div class="text">';
echo '<a href="'.base_url().'gallery/'.$row['alias'].'" alt="'.$row['title'].'"><h1>'.$row['title'].'</h1></a>';
echo '<p>'.$row['description'].'</p>';
echo '</div><div class="clear"></div></div>';
} ?>
</div>
[/quote]
I notice that in your controller you are not loading the model, is the model being autoloaded? Also you could check the server logs just after a white page (/var/logs/httpd/error_log) to see if there was a php error logged, alternatively use
Code:
if(1) {
ini_set('display_errors', 'on');
error_reporting(E_ALL);
}
This should allow error reporting on your live host, just remember to remove the snippet when you have finished debugging, or change the "1" to a "0"