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.

General Questions /

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

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

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


Reply


2 Posts   1553 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');