Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[SOLVED]Pages_Controller::require_once() Failed opening required


Go to End


2 Posts   2644 Views

Avatar
bebabeba

Community Member, 193 Posts

10 February 2009 at 6:21am

Edited: 10/02/2009 6:26am

Hi!
I need add an external php file. I don't knew where to add this file so I put in assets.
then in my Page.php I try to recall in my function but I have this error:

Page_Controller::require_once() [function.require]: Failed opening required 'assets/resize.php' (include_path='.;c:\php\pear;E:\_silverstripe_cms\prova\auth_openid\code;E:/_silverstripe_cms/prova/sapphire/parsers/') in E:\_silverstripe_cms\prova\mysite\code\Page.php on line 35

class Page_Controller extends ContentController {
function a()
{ require_once("assets/resize.php"); }

Avatar
bebabeba

Community Member, 193 Posts

10 February 2009 at 6:27am

I solve in this way:

require_once(Director::baseFolder() .'/assets/resize.php');