We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Fatal error: Call to undefined method EE_Input::fetch_uri_segment()

Development and Programming

davidlogan's avatar
davidlogan
37 posts
12 years ago
davidlogan's avatar davidlogan

I’ve updated from EE1 to EE2 and I’m getting the following error:

Fatal error: Call to undefined method EE_Input::fetch_uri_segment() in /Users/jonnyfrodsham/Sites/swimming-ee2/swimming.org/src/website/system/expressionengine/libraries/Functions.php(679) : eval()’d code on line 18

I found this old thread:

http://ellislab.com/forums/viewthread/191682/#904668

In here it the solution was to not allow templates to be saved as files this is no good for me.

Cheers Jonny

       
davidlogan's avatar
davidlogan
37 posts
12 years ago
davidlogan's avatar davidlogan

I see this is no longer a function we used it in the following fashion for EE1

global $IN; $segment_1 = $IN->fetch_uri_segment(1);

       
davidlogan's avatar
davidlogan
37 posts
12 years ago
davidlogan's avatar davidlogan

Fixed this using, many thanks for all the responses 😊

$this->EE =& get_instance(); $segment_1 = $this->EE->uri->segment(1);

       
Bhashkar Yadav's avatar
Bhashkar Yadav
727 posts
12 years ago
Bhashkar Yadav's avatar Bhashkar Yadav

Hi Jonny,

$segment_1 = $IN->fetch_uri_segment(1);

should be replaced with:

$this->EE =& get_instance();
$segment_1 = $this->EE->uri->segment(1);

If you are using EE2.6.0+ simply put:

$segment_1 = ee()->uri->segment(1);

I hope, it would help you.

       
davidlogan's avatar
davidlogan
37 posts
12 years ago
davidlogan's avatar davidlogan

Thanks on 2.6 just been reading up on the last last one you poosted.

Cheers Bhashkar

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.