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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

Call function from php file


Go to End


3 Posts   1000 Views

Avatar
ambient

Community Member, 130 Posts

6 August 2011 at 12:46am

Hi again Silverstripe community

I've been getting some help from a friend on something I'm trying but my friend has told me to call the function from the file he gave me.

Can someone tell me how to call the function from a php file in Silverstripe?

Project/TestFile.php

<?
require_once "project.php";

project_recent_sidebar("myaccountnamehere",10,0,"left","Text Here",true,"top","",true);
?>

Thanks :)

Avatar
zenmonkey

Community Member, 545 Posts

6 August 2011 at 6:53am

This one potentially really simple. Put the project.php into your mysite/code and do a dev/build?flush=all to rebuild the manifest. You may need to tweak the name of the file or the class in it to fit into the SS namespace. Then you don't even need to use require_once its just available.

Avatar
ambient

Community Member, 130 Posts

17 August 2011 at 12:54am

Thanks zenmonkey :)