Welcome Guest, Not a member yet? Register   Sign In
Strange problem with $this->load->view
#1

[eluser]Dionysius[/eluser]
Hi to all!
Here my routes.php:
Code:
$route['articles/:num'] = "articles/index";
$route['articles/:num/:num'] = "articles/index";

$route['files/:num'] = "files/index";
$route['files/:num/:num'] = "files/index";

Here is my test site based on CI 1.5.4: http://z-nsk.ru/ci/

URL http://z-nsk.ru/ci/files/3 works good. It loads controller "files" which gets data from DB.
But http://z-nsk.ru/ci/articles/<number> doesn't work correctly - it redirects to home page. I have found that all code in "articles" controller works correctly till string
Code:
$this->load->view('articles', $data);
It redirects browser O_o
If I changes it to
Code:
echo "blah-blah";
$this->load->view('articles', $data);
it says
Quote:blah-blah
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/z-nsk.ru/httpdocs/ci/system/application/controllers/articles.php:64)

Filename: helpers/url_helper.php

Line Number: 455
I can't understand WHY? If I changes this piece of code to
Code:
$this->load->_ci_load(array('view' => 'articles', 'vars' => $this->load->_ci_object_to_array($data), 'return' => false));
it works good!

Can somebody explain this mysticism?

And else: URL http://z-nsk.ru/ci/articles/view/<number> doesn't work anyway.

And all of these problems didn't appear at localhost.

Info:
Server: CentOS, Apache 2.0.52, PHP 4.3.9
Localhost: Windows XP, Apache 1.3.33, PHP 5.1.6


Messages In This Thread
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-27-2007, 02:54 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-27-2007, 03:30 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 12:03 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 01:44 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 02:17 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 05:15 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 08:47 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 10:39 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 11:55 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 09:32 PM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-28-2007, 09:39 PM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-29-2007, 02:41 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-29-2007, 03:09 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 11-29-2007, 03:45 AM
Strange problem with $this-&gt;load-&gt;view - by El Forum - 01-31-2008, 09:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB