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

Unable to load the requested file - View file not loading in fieldtype

Development and Programming

johnwbaxter's avatar
johnwbaxter
651 posts
14 years ago
johnwbaxter's avatar johnwbaxter

Hi,

I’m making a fieldtype and trying to load a view inside my display_field() function. The code i’m using to attempt this is the following:

$jeff = $this->EE->load->view(PATH_THIRD.'addon/views/selector_layout');
        
return $jeff;

But i get an error:

Unable to load the requested file: /Applications/MAMP/htdocs/eetest/system/expressionengine/third_party/addon/views/selector_layout.php

The file is in that directory, it’s spelled correctly.

Err..any ideas?

       
johnwbaxter's avatar
johnwbaxter
651 posts
14 years ago
johnwbaxter's avatar johnwbaxter

Okay, don’t worry about it, i’ve fixed it. Although, still seems like a silly error to me…

       
Wouter Vervloet's avatar
Wouter Vervloet
758 posts
14 years ago
Wouter Vervloet's avatar Wouter Vervloet

Shouldn’t that just be:

return $this->EE->load->view('selector_layout', $vars, TRUE);

If I’m correct EE automatically adds the add-on package path, so no need to specify it.

– Wouter

       
johnwbaxter's avatar
johnwbaxter
651 posts
14 years ago
johnwbaxter's avatar johnwbaxter

Wasn’t working for me.

I had

return $this->EE->load->view('selector_layout', TRUE);

originally, but that didn’t work, so then i looked in other peoples addons and the forums to get some hints and found someone in a forum suggesting

return = $this->EE->load->view(PATH_THIRD.'addon/views/selector_layout');

But that didn’t work, so then i looked in safecracker fieldtype which sets the package package path around it. Adding that seemed to work.

Weird stuff.

       
the3mus1can's avatar
the3mus1can
426 posts
14 years ago
the3mus1can's avatar the3mus1can

I would look this up in the bug tracker for the version of EE you are using and report it if you do not find that it has been fixed. You should not have to manually switch package paths in your add-ons.

       
johnwbaxter's avatar
johnwbaxter
651 posts
14 years ago
johnwbaxter's avatar johnwbaxter

Once i’ve finished what i’m doing i’ll look into it and test it further.

       

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.