Strange problem with $this->load->view |
[eluser]Dionysius[/eluser]
Hi to all! Here my routes.php: Code: $route['articles/:num'] = "articles/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); If I changes it to Code: echo "blah-blah"; Quote:blah-blahI 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)); 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
[eluser]Dionysius[/eluser]
Well, I just have changed PHP on localhost to 4.4.2 from 5.1.6 and these troubles appeared. Now I know, that this is a problem of PHP 4.
[eluser]Dionysius[/eluser]
If I change code of view() method to Code: echo "blah-blah";
[eluser]xwero[/eluser]
I'm guessing it has to do with the code in the view file where you use a url helper method. As you can see the error is generated from that file.
[eluser]Dionysius[/eluser]
But there are not redirect() calls in the view file articles.php. And I can change "articles" in $this->load->view() to "footer". footer.php has pure HTML. But result will be the same: redirecting to home page.
[eluser]Michael Wales[/eluser]
Then it has to do something with your routing or are you using caching?
[eluser]Dionysius[/eluser]
[quote author="walesmd" date="1196294103"]Paste your routing.[/quote] It is in my first post. .htaccess Quote:RewriteEngine on |
Welcome Guest, Not a member yet? Register Sign In |