CodeIgniter Forums
I want to smash my face in with a rusty crowbar (really weird bug) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: I want to smash my face in with a rusty crowbar (really weird bug) (/showthread.php?tid=22179)



I want to smash my face in with a rusty crowbar (really weird bug) - El Forum - 08-31-2009

[eluser]richthegeek[/eluser]
Hi

So i'm migrating a site from my dev localhost (PHP/MYSQL 5) to the live server (v 4 on all Angry) and I'm getting a really screwed up error.

Basically I have a "staff" folder in the controllers, and a "customer" controller (http://www.richardlyon.co.uk/customer.txt) which has "all" and "view" as its two methods (besides index and constructor).

However, when I go to "~/staff/customer/all" it *actually* goes to ~/staff/customer/view/staff/navigation

The staff/navigation part is a little wtf, but in my controller I have this:
Code:
$this->viewdata->add( "header", "navigation", $this->load->view( "staff/navigation", '', true ) );
        $this->viewdata->add( "header", "user", $this->authorise->get_current_user() );

The "viewdata" model is a simple class () that manages the viewdata across several methods and even from within models when required (its a complex site in other controllers). So the "staff/navigation" is coming from the view that I call in the controller. Tell me that makes sense??

Commenting it out solves it, but obv that farks it over in other ways (no navigation, for example).

Any idea why this might be occuring??http://www.richardlyon.co.uk/viewdata.txt


I want to smash my face in with a rusty crowbar (really weird bug) - El Forum - 08-31-2009

[eluser]richthegeek[/eluser]
Thought it might be worth nothing that this method doesnt cause problems *anywhere* else?


I want to smash my face in with a rusty crowbar (really weird bug) - El Forum - 08-31-2009

[eluser]sophistry[/eluser]
[quote author="richthegeek" date="1251780539"]
However, when I go to "~/staff/customer/all" it *actually* goes to ~/staff/customer/view/staff/navigation
[/quote]

that sounds like a route problem to me.


I want to smash my face in with a rusty crowbar (really weird bug) - El Forum - 09-01-2009

[eluser]richthegeek[/eluser]
that answer would make sense if the staff/navigation bit was going anywhere near the routes class, or if the site didnt already work on a PHP5 server.


I want to smash my face in with a rusty crowbar (really weird bug) - El Forum - 09-01-2009

[eluser]sophistry[/eluser]
oh. i see now. just change the name of your method so it is not "view"


I want to smash my face in with a rusty crowbar (really weird bug) - El Forum - 09-01-2009

[eluser]garymardell[/eluser]
Posting the viewdata class may prove useful.

didnt see above, as they said

http://ellislab.com/codeigniter/user-guide/general/reserved_names.html

in php 4 view is reserved for codeigniter.